Qry that returns top N records in each group

vettetax

New Member
Joined
Jul 5, 2006
Messages
47
Crystal Reports has a built-in query function to return the top "N" records in groups of data, not just the top "N" records in the table. Am I not able to replicate such a function using queries in Access? For example:

Group Customer Revenue
A 1 10
A 2 9
A 3 8
A 4 7
A 5 6
A 6 5
A 7 4
B 1 20
B 2 19
B 3 18
C 1 30
C 2 27
C 3 26
C 4 22
C 5 19
C 6 5


I need to query the top 3 records in each group so that if gives me the top 3 highest Revenue values in each Group?

Group Customer Revenue
A 1 10
A 2 9
A 3 8
B 1 20
B 2 19
B 3 18
C 1 30
C 2 27
C 3 26

Thanks for your assistance.

Dan
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,215,519
Messages
6,125,298
Members
449,218
Latest member
Excel Master

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