FreeriderUK
Well-known member
I am trying to generate a report showing a list of Invoices using Access DB.
I want to SELECT all Invoices in the table, but also include a total from the InvoiceDetails.
As long as I don't try to ORDER BY the InvTotalAmount, it works as expected:
My SQL looks similar to this:
When I do try to ORDER BY the InvTotalAmount, my report shows a line for each InvoiceDetail.
I think it must be unique to MS Access, since it works in SQL Server Management Studio.
Does anyone have any suggestions?
I want to SELECT all Invoices in the table, but also include a total from the InvoiceDetails.
As long as I don't try to ORDER BY the InvTotalAmount, it works as expected:
VB.NET:
Date Inv No. Total
--------------------------
01/02/03 11223344 525.65
My SQL looks similar to this:
VB.NET:
"SELECT InvoiceFields, SUM(tbInvDTL.Amount) AS InvTotalAmount
FROM (tbInvDTL INNER JOIN tbInvoices ON tbInvDTL.InvID = tbInvoices.InvID)
GROUP BY [same fields as SELECT]
ORDER BY " & SortOrderFieldName
When I do try to ORDER BY the InvTotalAmount, my report shows a line for each InvoiceDetail.
VB.NET:
Date Inv No. Total
--------------------------
01/02/03 11223344 120.15
01/02/03 11223344 285.20
01/02/03 11223344 120.30
I think it must be unique to MS Access, since it works in SQL Server Management Studio.
Does anyone have any suggestions?