Latest Date in a Field

RevDocJeff

New member
Local time
Today, 12:10
Joined
Jan 30, 2004
Messages
8
Hi, How can I determine, through a query, the latest date in a date field for a table.

The table has two fields. The first is Ref_No, the second is Rec_Date.

Ref_No Rec_Date
abc-1234 01/01/04
abc-1234 01/08/04
abc-1234 01/05/04
bcd-2345 02/17/04
bcd-2345 02/07/07
bcd-2345 02/21/04

I need the query to come back with only the latest date for each Ref_No:

abc-1234 01/08/04
bcd-2345 02/21/04

Thanks for any help
 
Create a new query: Paste this into the SQL View: SELECT YourTableNameHere.Ref_No, Max(YourTableNameHere.Ref_Date) AS MaxOfRef_Date
FROM YourTableNameHere
GROUP BY YourTableNameHere.Ref_No;

Hope that helps...
 

Users who are viewing this thread

Back
Top Bottom