Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: JimsterS Shepard
  Where is JimsterS Shepard?
 Dallas
 Texas - United States
 JimsterS Shepard
 To: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 Tags
Subject: RE: VFP and Sql Language
Thread ID: 78456 Message ID: 78843 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Visual Basic
Date: Sunday, October 09, 2005 5:57:25 PM         
   


> > I keep getting an error when I issue the following sql statement
> >
> > SET ENGINEBEHAVIOR 90
> >
> > SELECT account, category, year, SUM(cost) as tcost, ;
> > SUM(rendered) as trendered ;
> > FROM Laughton04assets ;
> > GROUP BY account
> >
> > All of the fields referenced are in the table referenced. The error implies I have a bad Group By clause. I really can't see what is wrong. Help!

>
> The GROUP BY clause must explicitly reference any fields that are not already defined as aggregate values. In your case it should be:
>
GROUP BY account,category, year

> This behavior was changed in VFP 8.0 and was done to move VFP into closer compliance with the ANSI 92 SQL standards, and to remove any possibility of erroneous results. The details are all listed in the help for SET ENGINEBEHAVIOR but they are in the section for "TO 80" though - which is probably why you missed them :)
>
> Regards
> Andy Kramek
> Microsoft MVP (Visual FoxPro)
> Tightline Computers Inc, Akron Ohio, USA


Andy thank you I am sorry I was so late in doing so.

Jim Shepard

ENTIRE THREAD

VFP and Sql Language Posted by JimsterS Shepard @ 10/4/2005 12:16:39 AM
RE: VFP and Sql Language Posted by Andy Kramek @ 10/4/2005 12:27:00 AM
RE: VFP and Sql Language Posted by JimsterS Shepard @ 10/9/2005 5:57:25 PM