Top 10

kathleen422

New Member
Joined
Jan 16, 2004
Messages
40
I have a table with the following data

Section
Item ID
Item Description
Qty
Amount


SELECT TOP 10 tbl_Stores.Section, tbl_Stores.[Item ID], tbl_Stores.[Item Description], Sum(tbl_Stores.Quantity) AS Qty, Sum(tbl_Stores.[Monetary Amount]) AS Amount
FROM tbl_Stores
WHERE (((tbl_Stores.[Accounting Date])=#9/30/2015#))
GROUP BY tbl_Stores.Section, tbl_Stores.[Item ID], tbl_Stores.[Item Description]
ORDER BY Sum(tbl_Stores.[Monetary Amount]) DESC;

I need for it to give me the top 10 for each section. Can someone tell me how to get that recordset
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
make a 'report' table to hold the results.
in your top 10 query make it append the data to the report table , BUT for 1 SECTION. (use a parameter)

run it N times for each Section you have.
 
Upvote 0
Ouch I have hundreds of sections. Thank you but surely there is another way to accomplish this. Somebody, Anybody Please help!
 
Upvote 0
Hi kathleen422 - Just a thought. If you filter the data, first by section, then by Qty, would not the first 10 rows in each section be what you want? Hope this helps. Good luck.
 
Upvote 0

Forum statistics

Threads
1,221,832
Messages
6,162,255
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top