You've to include all non-aggregate fields into GROUP BY, enclose them into agregate functions MIN()/MAX() or remove them from the colimn list. It's documented in VFP9 help under
SET ENGINEBEHAVIOR and in
INFO: SQL SELECT Behavior Changes in Visual FoxPro 8.0 mskb #
813361.
>I am working with an application written in VFP 6 and keep running into problems with sql statements containing a Group By clause. I haven't found a common denominator. Any ideas?
>
>Here is an example cut from the code:
>
>
>SELECT ;
> receipt.rec_date,receipt.receipt_no, paidinv.inv_no, ;
> receipt.type, receipt.card_no, receipt.exp_date, ;
> receipt.amount, receipt.country, receipt.exch_rate ;
> WHERE receipt.type $ "AMV" .and. receipt.rec_date = date() ;
> FROM receipt ;
> INNER JOIN paidinv ON receipt.receipt_no = paidinv.receipt_no ;
> Group By Receipt.receipt_no ;
> ORDER BY type ;
> INTO CURSOR dispcred
>
>
>Thanks, Jeffrey
--sb--