Re: GROUP BY Clause Problem in VFP8

From: Fred Taylor (ftaylor_at_mvps.org!REMOVE)
Date: 10/16/04


Date: Sat, 16 Oct 2004 16:22:58 -0700

VFP 8's SQL has been brought more into line with the the SQL standard. This
is correct operation of a SQL statement, though if you've gotten used to
VFP's earlier incorrect usage, it may not seem so.

So tell me, which ssn goes with which checkname in your select? It's
ambiquous.

You can do SET ENGINEBEHAVIOR 70 to have it work in the old style, or you
can aggregate your ssn field with either a MIN or a MAX function. I do
believe that MAX(ssn) will give you the same results as previous versions of
VFP.

-- 
Fred
Microsoft Visual FoxPro MVP
"Steve Meyerson" <stevemeyerson@cox.net> wrote in message 
news:i453n0l3j9q98mi10mb18iggr4qbe5tj8m@4ax.com...
> The following worked fine in VFP6:
>
> SELECT CheckName, Ssn ;
>  FROM Payroll ;
>  INTO TABLE TempPay ;
>  GROUP BY CheckName
>
> In VFP8 I get the error msg:
>
> SQL: GROUP BY clause is missing or invalid
>
> even when I ran it from the command window.
>
> It will work ok  if I SELECT only one field instead of 2 or more, but
> that's not acceptable.
>
> Payroll is a free dbf.  I tried copying Payroll.dbf to "convert" it in
> case that was necessary. I also created a simple dbf in VFP8 and got
> the same behavior.
>
> Any clue what's going on? Thanks for any help.
>
>
> Steve Meyerson
>
>