Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report showing products in descending order 1

Status
Not open for further replies.

primerov

Technical User
Aug 16, 2002
160
0
0
BG

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?





 
Hi

If the Sorting and grouping of the REPORT, you say you have:

"In the Sorting and grouping optioins of the report i have :
productid ascending"

surely you need

SumOfliters Descending




Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thank you so much for your reply. I know that the fault is mine.I didnt explain in full what i need.
I still cannot make my report working.In the Sorting and Grouping window
i have put:
SumOfLiters - descending
ProductID - ascending

The report so obtained give me a nice view for the totals of all products. However, it does not list the products according to the the total quantity
sold. This quantity is not SumOfLiters,but the sum of it.to be found in the ProductID footer and is :
=Sum([SumOfliters])

Therefore, what i want is to arrange my products in descending order
not according their SumOfLiters, but according to their =Sum([SumOfliters])
which is in the report footer and giving summarized quantity of the each product.
Is it possible to put that =Sum([SumOfliters]) in the Sorting and Grouping window?.
I have tried, but it says that i have an extra bracket which is not true
 
HI

OK, I get the problem

Create another query summy by ProductId, in your original query on which the report is based, include the 'new' query with a join on ProductId, include the SumbyProduct in the report (visible = false if you do not want to see it), and change your sort settings to suit

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top