Select latest date

sheriff

New member
Joined
May 14, 2007
Messages
2
Hi all

I have the following data
Doc# Date
1 2 Jan 2007
2 10 May 2007
2 14 May 2007

I want the latest entry for each document.
Results should look like this:
Doc# Date
1 2 Jan 2007
2 14 May 2007

How do I go about doing this?

Thanks in advance
 
Two keys elements are needed: "GROUP BY" and "MAX".
For your simple query, heres the SQL:
Code:
SELECT [Doc#], MAX(Date) AS [Date]
FROM Table1
GROUP BY [Doc#]

-ners
 
Back
Top