Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group By & Sum Clause Error in Select
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00799071
Message ID:
00799108
Vues:
24
>No same thing.
>-Mark

Mark, are you sure it fails?
I am asking because it works fine for me:
CLOSE DATABASES all
CLEAR
?SET("EngineBehavior")

CREATE CURSOR invoice (nID I,nInvoiceNumber I, dInvoiceDate D)

CREATE CURSOR InvoiceDetail (nParentID I,nQuantity I, nUnitPrice Y)

SELECT invoice.nInvoiceNumber, invoice.dInvoiceDate, ;
SUM(invoicedetail.nQuantity*invoicedetail.nUnitPrice) AS nTotal ;
FROM Invoice, InvoiceDetail ;
WHERE Invoice.nID = InvoiceDetail.nParentID ;
GROUP BY nInvoiceNumber, dInvoiceDate Order BY nInvoiceNumber

return
Thanks,
Aleksey.

>
>>Have you tried (it still may not work because of sum of multiplied fields?):
>>
>>
>>SELECT invoice.nInvoiceNumber, invoice.dInvoiceDate,
>>SUM(invoicedetail.nQuantity*invoicedetail.nUnitPrice) AS nTotal
>>FROM Invoice, InvoiceDetail
>>WHERE Invoice.nID = InvoiceDetail.nParentID
>>GROUP BY nInvoiceNumber, dInvoiceDate Order BY nInvoiceNumber
>>
>>
>>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform