TOP values

D

Dina

Hi,

I am having trouble returning the top values in a GROUP BY or TOTALS query.
I would like to GROUP BY an attribute (Accounts) and return the top 5 values
(Deposits) per account holder.

I am having trouble because the GROUB BY MAX function only returns one value
(the max value) PER ACCOUNT and I need it to return the highest 5 values.

Your help is appreciated. Thanks in advance.
Dina
 
D

Dina

Hi Allen,

Many thanks for the link. In the link you provided me, OrderID is unique.
Do I HAVE to have a unique attribute for this to work??

Thank you,
Dina
 
A

Allen Browne

It doesn't have to be a single field, but there does have to be some way to
determine which fields constitute the related records if you are to choose
the top 5 for each one.
 
D

Dina

Ok, thanks Allen. I managed to use your advice & it worked.

As a follow up/related question:

Instead of selecting the Top 5 records per account holder in the subquery,
is there a way to select every 2nd (or 3rd etc) record per account holder?

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Top 5 by group 0
VBA Coding Help for Beginner 0
Top 3 per group 3
Greatest date per Unit 3
Multiple Top Values 2
TOP N Records with 2 tables 1
Top 50% Grouped by Month 3
updatiing top values into table 0

Top