View Single Post
Old 11-12-2019, 08:23 AM   #10
RJW
Newly Registered User
 
Join Date: Sep 2006
Posts: 38
Thanks: 9
Thanked 0 Times in 0 Posts
RJW is on a distinguished road
Re: Query for MAX value

plog,

Answering using the sample data wouldn't explain it clearly. I posted a limited data set because I thought it was going to a simple solution. It turns out to be not so simple (from my perspective)

The actual table has 500 records.
18 records with DriveID 15
19 records with DriveID 13
28 records with DriveID 11
36 records with DriveID 9
27 records with DriveID 7

At the moment 15 is the highest value for the field DriveID

I need 4 separate queries for the highest 4 DriveID values.

Query A would have 18 records (15)
Query B would have 19 records (13)
Query C would have 28 records (11)
Query D would have 36 records (9)

When the next batch of new records get entered, then ...

Query A would have ?? records (17)
Query B would have 18 records (15)
Query C would have 19 records (13)
Query D would have 28 records (11)

I hope this explanation clears up my issue.

Thanks to everyone for helping

RJW
RJW is offline   Reply With Quote