Sorting in Data Grid
I keep getting this error when trying to sort by OrderID within a datagrid:
The specified field 'OrderID' could refer to more than one table listed in the FROM clause of your SQL statement.
I have seen from other Forums that this usually occures when you do not have an alias for DB tables and columns are specificly defined. Here is my SQL:
SELECT DISTINCTROW [Order Details].OrderID, Sum(CCur([UnitPrice]*[Quantity]*(1-[Discount])/100)*100) AS Total, Orders.OrderDate, Orders.CustomerID
FROM Orders INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
GROUP BY [Order Details].OrderID, Orders.OrderDate, Orders.CustomerID;
Any one have ideas?
Also, does anyone know how to sort a Sum field?