theknight571
Platinum Member
I have a table that consists of:
Unique ID, Date, PersonID, lots of misc fields that may or may not be different with each record.
1,201006,0001,...
2,201001,0001,...
3,201006,0002,...
4,201006,0002,...
5,201001,0003,...
6.201006,0004,...
7.201001,0004,...
What I need is a query that gives me just the most recent entry for each PersonID
1,201006,0001,...
3,201006,0002,...
5,201001,0003,...
6,201006,0004,,,,
The SQL I've found so far uses SELECT UID, MAX(Date), PersonID but groups on each field... which still gives me all the records, since each one has a unique ID.
What am I missing? I can't group all the fields since I'll still get all the records since each is unique.
Any suggestions would be helpful.
I'm also searching so if I find something that works I'll post back.
Thanks.
Unique ID, Date, PersonID, lots of misc fields that may or may not be different with each record.
1,201006,0001,...
2,201001,0001,...
3,201006,0002,...
4,201006,0002,...
5,201001,0003,...
6.201006,0004,...
7.201001,0004,...
What I need is a query that gives me just the most recent entry for each PersonID
1,201006,0001,...
3,201006,0002,...
5,201001,0003,...
6,201006,0004,,,,
The SQL I've found so far uses SELECT UID, MAX(Date), PersonID but groups on each field... which still gives me all the records, since each one has a unique ID.
What am I missing? I can't group all the fields since I'll still get all the records since each is unique.
Any suggestions would be helpful.
I'm also searching so if I find something that works I'll post back.
Thanks.