Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SUM function in VFP 8.0 SQL
Message
From
20/03/2004 11:47:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00888077
Message ID:
00888215
Views:
8
>Why do I get the error message, "sum.prg does not exist"? This didn't happen in rpeviopus version s of VFP, but I do understand that some SQL code has been tightened up. So, what do I use if not SUM()?
>
>
>SELECT ;
>		APTRXFIL.VOUCHER_NO, ;
>		APTRXFIL.INV_AMT, ;
>		SUM(APTRXDST.DST_AMT) AS DST_AMT ;
>	FROM ;
>		APTRXFIL, ;
>		APTRXDST ;
>	WHERE ;
>		APTRXFIL.VOUCHER_NO = APTRXDST.VOUCHER_NO AND;
>		APTRXFIL.INV_AMT <> SUM(APTRXDST.DST_AMT) ;
>	GROUP BY ;
>		APTRXFIL.VOUCHER_NO, ;
>		APTRXFIL.INV_AMT ;
>	INTO CURSOR tmpAPTransactions
>
Cecil,
I think it existed in all versions. There is a sum() in your where clause. Try using a having clause instead :

WHERE ;
APTRXFIL.VOUCHER_NO = APTRXDST.VOUCHER_NO ;
having APTRXFIL.INV_AMT <> SUM(APTRXDST.DST_AMT) ;

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform