TOP 1 Query from each ID with multiple instances

calendar_today Asked Jan 27, 2012
thumb_up 9 upvotes
history Updated April 16, 2026

Question posted 2012 · +4 upvotes

This query will return the top for all rows in MS Access.

SELECT TOP 1 * FROM [table]
ORDER BY table.[Date] DESC;

I need to return the top date for each id that can have multiple dates.

ID      DATE
1      01/01/2001
1      01/12/2011
3      01/01/2001
3      01/12/2011

Should return only the top dates like this.

1      01/12/2011
3      01/12/2011

Accepted answer +9 upvotes

You’ll want to use the MAX function, along with a GROUP BY.

SELECT ID, MAX(DATE)
FROM [table]
GROUP BY ID

Top ms-access Q&A (6)

+9 upvotes ranks this answer #22 out of 55 ms-access solutions on this site .