Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Code worked in VFP 6.0 but not VFP 8.0
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00818362
Message ID:
00818366
Views:
23
Cecil,
If you have an aggregate function (in this case SUM()), you need to have a GROUP BY clause. VFP 8 has had modifications like this implemented to make it more ANSI compatible. Simply add the 5 other fields to a GROUP BY clause and it should work.

HTH.

>The following code, worked in VFP 8.0 but not VFP 8.0. What's up? An error message stated that a GROUP BY clause was either missing or invalid.
>
>SELECT ;
> V_POHeaderPI.Project_No, ;
> V_POHeaderPI.Account_No, ;
> V_POHeaderPI.PO_Main, ;
> V_POHeaderPI.PO_Total, ;
> V_POHeaderPI.PO_Status, ;
> SUM(V_POCostsPI.cs_amount) AS nInvoiced ;
> FROM V_POHeaderPI;
> LEFT OUTER JOIN V_POCostsPI ON V_POHeaderPI.PO_Main = V_POCostsPI.PO_Main ;
> WHERE ;
> V_POHeaderPI.PO_Main = ThisForm.cPO_Main AND ;
> PO_Status <> "U" ;
> INTO TABLE tmpPOHeader
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform