473,509 Members | 12,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Report showing products in descening order



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?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
2 3104
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do you want the liters sorted within the ProductID grouping? If so in
the report's Sort/Group By dialog box put the ProductID field above
the SumOfLiters field and set the SumOfLiters order Descending. This
will give a result like this:

ProductID Grade Size SumOfLiters
- --------------------------------------
1 a 2" 250
1 z 3" 100
1 x 1" 50
3 t 10" 400
3 c 2" 38
25 a 3" 1000
25 z 11" 60

If you don't care about the sort order of the ProductID then put the
SumOfLiters field above the ProductID field in the Sort/Group By
dialog box. This will give a result like this:

ProductID Grade Size SumOfLiters
- --------------------------------------
3 a 5" 250
5 z 10" 100
1 x 1" 50

- --
MGFoster:::mgf
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP4rrt4echKqOuFEgEQKPfgCeI0Y+C/kM+O8owIXxNm0vvoY1mwMAn0jO
k4ctfd7fKGP3grcrMNRt5Xmj
=/GRX
-----END PGP SIGNATURE-----

Hohn Upshew wrote:

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?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #2
I had a little difficulty determining just how you were trying to accomplish
arranging the data in descending order.

Grouping and Ordering in reports is, indeed, controlled by the Sorting and
Grouping properties you have specified. If the "Sumofliters" field in your
query is the first item in Sorting and Grouping, and you have selected
Descending order, then that's the way your Report should be arranged.

If you have some other field in the Sorting and Grouping list before
Sumofliters, then, of course, Sumoflitiers would not be the highest level
sort, but only a sort within a higher-level sorting or grouping.

Larry Linson
Microsoft Access MVP
"Hohn Upshew" <fa*****@yahoo.com> wrote in message
news:3f*********************@news.frii.net...


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?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
17632
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
13
3872
by: salad | last post by:
Hi Guys: I was stuck. I needed to send a report to a file. My beautiful report(s) in Access were going to require loss of formatting with RTFs, a PITA in WordMailMerge, sending it as a text...
2
3211
by: jburris | last post by:
In my current database, I have a single table which contains order information such as product, unit price and payment. The payment for each product is entered in and subtotals and totals are...
0
1059
by: karlbaker02 | last post by:
Hi. I am currently creating a database for all of my customers and the products that they order. I have made a form that contains a link to open a report. When this is clicked, the report pulls out...
3
1309
by: igendreau | last post by:
I have a table and each record lists a Company Name, Order Date, and an Extended Sell Price. What I need to create is a report with 4 columns: Company Name, 2004 Sales, 2005 Sales, 2006 Sales. ...
11
1932
by: Ryan | last post by:
I am writing a VB (2005) program that will allow the user to fill out and print a form. The form input is stored in a database (SQL 2005) to be retrieved/viewed/printed later. The form is...
1
2782
by: kamalis14 | last post by:
I am trying to create a summary report that will be run monthly for Clients. I just cant seem to work it out. Each client can order 3 types of products. Each type consists of product codes describing...
1
3023
by: Sport Girl | last post by:
Hi everybody , i have the task of developing in Perl a script that retrieves data from 3 tables ( bugs, profiles, products) from a MySQL database called bugs and display them in an excel sheet...
2
2381
by: awojciehowski | last post by:
Can any one point me in the right direction here... I have a report that shows an entry and under that record there are several sub records...best way to explain it is imagine an order with...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.