I have tried searching through the forum but can't seem to find any solutions for the following. I am sure one exists but didnt have any more spare time sifting through.
How can I pull the previous record depending on date effective. For example. I have a rate history table. I need to pull in the row, the emp ID, Name, rate, rate date and then rate prior to rate(rate amount which was effective prior to this record.
So if ANnie had effective 10/01/02 a rate of 10.00. On 11/01/02 his rate was 12.00. On 01/01/03 his rate was 15.00. I need my query to show-
Name ID Rate Date Rate Previous Rate
Annie 5607 01/01/03 15.00 12.00
Annie 5607 11/01/02 12.00 10.00
Annie 5607 10/01/02 10.00 0
I am also needing it to work in case a date is time stamped. There can't be duplicate dates for the same employee and sometimes they recieve an increase and also a promotion on the same day so the latter would have the time added to the date. ANy help would be greatly appreciated
How can I pull the previous record depending on date effective. For example. I have a rate history table. I need to pull in the row, the emp ID, Name, rate, rate date and then rate prior to rate(rate amount which was effective prior to this record.
So if ANnie had effective 10/01/02 a rate of 10.00. On 11/01/02 his rate was 12.00. On 01/01/03 his rate was 15.00. I need my query to show-
Name ID Rate Date Rate Previous Rate
Annie 5607 01/01/03 15.00 12.00
Annie 5607 11/01/02 12.00 10.00
Annie 5607 10/01/02 10.00 0
I am also needing it to work in case a date is time stamped. There can't be duplicate dates for the same employee and sometimes they recieve an increase and also a promotion on the same day so the latter would have the time added to the date. ANy help would be greatly appreciated