L
ldmccarty
I have a table with
Student ID EventID EventDate (for example)
573 2670 7/1/2007
573 2716 7/1/2006
I'd like to return the EventID of the last EventDate for each Student.
I've tried many variations of Max and Last, but because I want to
bring back the EventID, I keep doing a GROUPBY on EventID and then I
get multiple rows instead of just the most recent row.
In the example above, I'd want to return
573, 2670 (so that I can join event 2670 to the event table to find
out more about it).
But I keep getting both records returned.
Can anyone help with this query?
Thanks
LD
Student ID EventID EventDate (for example)
573 2670 7/1/2007
573 2716 7/1/2006
I'd like to return the EventID of the last EventDate for each Student.
I've tried many variations of Max and Last, but because I want to
bring back the EventID, I keep doing a GROUPBY on EventID and then I
get multiple rows instead of just the most recent row.
In the example above, I'd want to return
573, 2670 (so that I can join event 2670 to the event table to find
out more about it).
But I keep getting both records returned.
Can anyone help with this query?
Thanks
LD