Re: Group by clause
  Home FAQ Contact Sign in
microsoft.public.fox.vfp.queriessql only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Group by clause         

Group: microsoft.public.fox.vfp.queriessql · Group Profile
Author: Cindy Winegarden
Date: Mar 23, 2007 08:38

Hi APA,

I'm not sure whether you've chosen to modify your query or to use SET
ENGINEBEHAVIOR 70 to allow your query to run as-is. But for others reading
here....

While we are often familiar enough with our data to know that all the fields
except one will have the same value, we really can't be sure. Setting
ENGINEBEHAVIOR to 70 will allow the query to run, but the query is faulty
and the values in all those other fields are meaningless. VFP generally uses
the last value it sees but there may be other values in the data.

It's really best to list every field in the Select clause, except
aggregates, in the Group By clause.

--
Cindy Winegarden
cindy@cindywinegarden.com

VFP OLE DB: http://msdn2.microsoft.com/en-us/vfoxpro/bb190232.aspx
VFP ODBC: http://msdn2.microsoft.com/en-us/vfoxpro/bb190233.aspx

"apa" wrote in message
news:8VyMh.49848$DN.47265@pd7urf2no...
> Nevermind.. I found it already.
>
> http://support.microsoft.com/default.aspx?scid=kb;en-us;813361&Product=Vfp8
>
>
> "apa" wrote in message
> news:mxyMh.50283$zU1.31009@pd7urf1no...
>> This thing works fine in VFP 7 when i try to execute it, but in version 9
>> it gives me an error GROUP By clause missing or invalid. Anything im
>> missing here?
>>
>> SELECT MIN(workdate) as DStart, MAX(workdate) as Dend, military1 as
>> tStart, military2 as tEnd,orno as Croom, ;
>> cweeks as cWeeks, cDays as Cdays, laway as laway, cawaydsc as
>> cdsc,CRANGGRPID as rangegroupid ;
>> FROM staffdtl ;
>> WHERE staffid = "XXX" ;
>> GROUP BY CRANGGRPID ;
>> ORDER BY dDateStart, dDateEnd, itimeStart, itimeEnd ;
>> INTO CURSOR cTest
no comments
diggit! del.icio.us! reddit!