sort by latest date with mutiple IDs

  • Thread starter Thread starter tylerd
  • Start date Start date
T

tylerd

Guest
I'm trying to sort dates by the latest date when the query returns multiple IDs with different results. Ex.
ID1 1/1/2006
1/8/2006
ID2 1/2/2006
1/9/2006

In this example I would want ID1 with the date of 1/8/2006 and ID2 with the date of 1/9/2006 since they are the latest date. I will have many IDs that I need to run a query on that will all return the latest date. TIA
 
Not sure if it's what you mean but will a group query taking the max of the date field not work.

SELECT YourIDField, Max(YourDateField) AS MaxDate
FROM YourTableName
GROUP BY YourIDField;
 

Users who are viewing this thread

Back
Top Bottom