dukeslater
Technical User
I'm sure there's a standard, simple technique for this but it's been one of those "beat your head on the desk" kind of days.
Standard table which stores payroll history - empID, rate, changedate:
1001 15.00 1/1/2004
1001 15.50 1/1/2005
1001 16.00 1/1/2006
I need a query to return the current rate and date, and also the previous most recent rate and date:
EmpID CurrentRate CurrentDate PreviousRate PreviousDate
1001 16.00 1/1/2006 15.50 1/1/2005
1002 21.00 12/1/2005 18.50 3/1/2005
I'm hitting all around it by populating a temp table, but can't quite get it right. Thanks for the help!
Standard table which stores payroll history - empID, rate, changedate:
1001 15.00 1/1/2004
1001 15.50 1/1/2005
1001 16.00 1/1/2006
I need a query to return the current rate and date, and also the previous most recent rate and date:
EmpID CurrentRate CurrentDate PreviousRate PreviousDate
1001 16.00 1/1/2006 15.50 1/1/2005
1002 21.00 12/1/2005 18.50 3/1/2005
I'm hitting all around it by populating a temp table, but can't quite get it right. Thanks for the help!