tanvirtonu
New member
- Local time
- Yesterday, 17:53
- Joined
- Nov 3, 2008
- Messages
- 3
Why cant I execute the following query in MsAccess-
It says " you tried to execute a query that doesn't include the specified expresiion "ID" as part of an aggregate function "
But I can execute this-
Can't I select multiple columns in aggregation? PLs help me.
Code:
SELECT SalesInvoice.ID, SalesInvoice.CustomerID, SalesInvoice.Commission, Sum(SalesInvoice.TotalAmount) AS SumOfTotalAmount
FROM SalesInvoice
GROUP BY SalesInvoice.CustomerID;
But I can execute this-
Code:
SELECT CustomerID, Sum(TotalAmount) AS SumOfTotalAmount
FROM SalesInvoice
GROUP BY CustomerID;