Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

7.0 to 8.0 version error 3

Status
Not open for further replies.

Germancho

Programmer
Jul 9, 2003
36
I upgraded to 8.0 version. I still keep the 7.0. When I run the EXE generated on 8.0 file I get the error "SQL: GROUP BY is missing or not valid". If I use the 7.0 version there is no problem. What can I do?
 
Or correct the reason your SQL Statement is invalid in 8.0 (and 9.0, SQL Server, Oracle, MySQL, MS Access, etc.!).

Rick
 
Read the "What's New" topic in the help file. You'll find and explanation of what you need to do and why this behavior was changed.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Germancho,

Although Marcia has given you a quick workaround which should get rid of the error message, I think Rick's suggestion is better.

The point is that, if you simply SET ENGINEBEHAVIOR 70 without looking for the underlying causes of the error, you risk getting misleading data in the result set.

The reason is that you are including a field in the result set that could have different values in each record in the group. VFP has no way of knowing which of those values is relevant to you, so it just inserts the value from an arbitrary record within the group (or it might be the first record -- I'm not sure).

The basic rule is this: If you have a GROUP BY, then the only expressions permitted in the result set are (i) aggregate functions and (ii) the fields that you are grouping on.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top