how to get the last date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

There is a table called Events with two fields EventsID and HeldDate, now I
want to make a query to give me a list with two columes, EventsID and
LastHeldDate.

That is, if I have the following data:

EventID HeldDate
1 01/01/05
2 05/01/05
1 15/01/05
2 02/02/05


The query should give me:

EventID LastHeldDate
1 15/01/05
2 02/02/05


Any help will be highly appreciated.
 
Minnow said:
There is a table called Events with two fields EventsID and HeldDate, now I
want to make a query to give me a list with two columes, EventsID and
LastHeldDate.

That is, if I have the following data:

EventID HeldDate
1 01/01/05
2 05/01/05
1 15/01/05
2 02/02/05


The query should give me:

EventID LastHeldDate
1 15/01/05
2 02/02/05


SELECT EventID, Max(HeldDate) As Latest
FROM Events
GROUP BY EventID
 
Back
Top