T
Tom Alway
Okay, I'm going to try this again. I posted a question
last week and got a correct answer for the information
that I requested. I guess it would have helped if I gave
the correct information. Anyway, here is my problem
(again). I have a table that contains the following
information:
Emp_Name Number Start_date Dept
Adams, Bob 51 7/1/2000 Training
Adams, Bob 51 7/31/2004 Games
Smith, Jim 75 1/1/2000 Food
Smith, Jim 75 1/1/2004 Shipping
Johns, Mark 23 6/3/2000 Shipping
Johns, Mark 23 6/3/2004 Maint
Hansen, Sue 12 1/1/2000 Admin
Hansen, Sue 12 1/5/2004 Games
Adams, Mary 44 7/1/1999 Training
Adams, Mary 44 8/7/2004 Food
I wish to query the data and return the most recent start
date that a particular person had and the department
where they started. Therefore my results would look like:
Name Number Startdate Dept
Adams, Bob 51 7/31/2004 Games
Smith, Jim 75 1/1/2004 Shipping
Johns, Mark 23 6/3/2004 Maint
Hansen, Sue 12 1/5/2004 Games
Adams, Mary 44 8/7/2004 Food
As suggested from my earily post, I have tried using
SELECT Name, MAX([Startdate]) AS MostRecentDate
FROM MyTable
GROUP BY Name;
and can get it to work for two columns (name and
startdate) but when I add all of the columns I end up
with invalid data. Any help would be greatly appreciated.
Thank you.
last week and got a correct answer for the information
that I requested. I guess it would have helped if I gave
the correct information. Anyway, here is my problem
(again). I have a table that contains the following
information:
Emp_Name Number Start_date Dept
Adams, Bob 51 7/1/2000 Training
Adams, Bob 51 7/31/2004 Games
Smith, Jim 75 1/1/2000 Food
Smith, Jim 75 1/1/2004 Shipping
Johns, Mark 23 6/3/2000 Shipping
Johns, Mark 23 6/3/2004 Maint
Hansen, Sue 12 1/1/2000 Admin
Hansen, Sue 12 1/5/2004 Games
Adams, Mary 44 7/1/1999 Training
Adams, Mary 44 8/7/2004 Food
I wish to query the data and return the most recent start
date that a particular person had and the department
where they started. Therefore my results would look like:
Name Number Startdate Dept
Adams, Bob 51 7/31/2004 Games
Smith, Jim 75 1/1/2004 Shipping
Johns, Mark 23 6/3/2004 Maint
Hansen, Sue 12 1/5/2004 Games
Adams, Mary 44 8/7/2004 Food
As suggested from my earily post, I have tried using
SELECT Name, MAX([Startdate]) AS MostRecentDate
FROM MyTable
GROUP BY Name;
and can get it to work for two columns (name and
startdate) but when I add all of the columns I end up
with invalid data. Any help would be greatly appreciated.
Thank you.