Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Latest Date

Status
Not open for further replies.

M8KWR

Programmer
Aug 18, 2004
864
GB
I have a table with multiple entries per ID number.

What i want is the query to show only the latest Date entry for each ID number.

So if i have for example
IDNo Date
1 01/07/05
1 27/06/05
2 05/07/05
2 04/05/05
3 01/09/05
3 25/08/05

I need it to just show

IDNo Date
1 01/07/05
2 05/07/05
3 01/09/05


I hope i have explained myself ok, many thanks for the help in advance.
 
SELECT IDNo, Max(Date) AS LatestDate
FROM yourTable
GROUP BY IDNo;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i thought it was that, many thanks for the quick response.
 
Can you explain this? Did you do this within the query critera?
 
You can paste this query in the SQL view, modify the table and field names, switch back to the QBE and "see" how the criteria is set up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top