(Edited by HansV on 13-Oct-03 11:37. Removed superfluous line breaks)
I need some help to build a report enumerating the products in descending order depending on the sum of liters. In this way i can view the top products sold for a given period.But i fail to do it. In my query i have build a total as follows
SELECT products.Productid, products.grade, products.size, Sum([order details].liters) AS SumOfliters, orders.invoicedate
FROM products INNER JOIN ((affiliates INNER JOIN Customers ON affiliates.afid = Customers.afid) INNER JOIN (orders INNER JOIN [order details] ON orders.orderid = [order details].OrderID) ON Customers.Customerid = orders.customerid) ON products.Productid = [order details].ProductID
GROUP BY products.Productid, products.grade, products.size, orders.invoicedate
ORDER BY Sum([order details].liters) DESC;
In this query i do not have the whole quantity of each product, but i do not want to make use of two queries. I have succeeeded to build a query enumerating each product with the total quantity for this product, but this quantity is not in descending order, beging with the biggest sum of liters. In the Sorting and grouping optioins of the report i have :
productid ascending
Adding “sumofliters” in this option does not change the order or the products shown. Can somebody help me build a report showing the sums of liters for each product in descending order?