Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fixing SQL statements for VFP8
Message
From
16/06/2004 15:28:02
 
 
To
16/06/2004 15:19:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00914398
Message ID:
00914402
Views:
11
Beth,

First, you can avoid the issue by setting ENGINEBEHAVIOR TO 70. That way, existing VFP6 queries should run OK in VFP8.

But to answer your question...what this means is that if you're using a GROUP BY, any columns in your SELECT statement that are not aggregated (i.e. SUMMARIZED) must be included in the group by.

So if you had...

SELECT SSN, FirstName, lastname, SUM(checkamt) from GROUP BY SSN

That will not work in VFP8, because all non-aggregate columns (columns you're not summarizing...ssn, firstname, lastname) must be included in the group by...

The correct syntax would be

SELECT SSN, FirstName, lastname, SUM(checkamt) from GROUP BY SSN, FIRSTNAME, LASTNAME

Again, if you SET ENGINEBEHAVIOR TO 70, you don't need to change your queries. Having said that, the 1st example will never work in SQL Server, and I generally recommend coding the same way (just my opinion).

Hope that helps,
Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform