Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group By & Sum Clause Error in Select
Message
From
11/06/2003 16:42:41
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00799071
Message ID:
00799127
Views:
25
You must include
invoice.nInvoiceNumber, invoice.dInvoiceDate
in the GROUP BY. I'd hope nInvoiceNumber is the same for all records with the same Invoice.nID, so you should be able to drop Invoice.nID from the GROUP BY.

>Maybe I am just being brain dead today, but I upgraded to VFP 8, and cannot get the following SELECT to work. I am getting a GROUP BY clause error and have read past messages and Microsoft's site but I still cannot get it!!!
>
>I have even tried the View Designer and I get the same error message.
>
>
>SELECT invoice.nInvoiceNumber, invoice.dInvoiceDate,
>SUM(invoicedetail.nQuantity*invoicedetail.nUnitPrice) AS nTotal
>FROM Invoice, InvoiceDetail
>WHERE Invoice.nID = InvoiceDetail.nParentID
>GROUP BY Invoice.nID Order BY invoice.nID
>
>
>What is wrong???????? I know I can bypass the problem with the SET ENGINEBEHAVIOUR 70, but I would really like to know what the correct syntax should be.
>
>TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform