I am sure this is a very easy question; I am just having a hard time figuring it out from the SQL online documentation. I need to write a query that lists only the last entered record, by employee ID, for the selected table. For example:
I have a table with the following fields:
ID - NameID - Date Entered.
1 – A1 – 1/1/01
2 – A1 – 2/5/01
3 – A2 – 3/2/02
4 – A3 – 4/19/02
5 – A1 – 5/5/02
I need the query to generate the following:
3 – A2 – 3/2/02
4 – A3 – 4/19/02
5 – A1 – 5/5/02
Thus, it would suppress ID#1 & 2, since they are not the last record for employee A1. How would I write the SQL statement to accomplish this? Thank you in advance.
Scott
I have a table with the following fields:
ID - NameID - Date Entered.
1 – A1 – 1/1/01
2 – A1 – 2/5/01
3 – A2 – 3/2/02
4 – A3 – 4/19/02
5 – A1 – 5/5/02
I need the query to generate the following:
3 – A2 – 3/2/02
4 – A3 – 4/19/02
5 – A1 – 5/5/02
Thus, it would suppress ID#1 & 2, since they are not the last record for employee A1. How would I write the SQL statement to accomplish this? Thank you in advance.
Scott