I have a table with pay rates and effective dates in it and I need to calculate the total pay for the period based on the effective dates. Here's an example of the data for an employee:
Employee, Effective Date, Amount
1234 , 01/01/2011 , 50.00
1234 , 03/01/2011 , 52.00
1234 , 06/01/2011 , 55.00
I need to be able to get the Next Value of the effective date in order to calculate the pay amount for the date range. So for the first record, I would need to be able to get the start date of 3/1/2011, so I could calculate the pay between the days of 1/1/2011 and 2/28/2011. I can get the next start date of 3/1/2011 fine, but the problem is I can't perform any running totals or aggregate functions.
Any other ideas?
Employee, Effective Date, Amount
1234 , 01/01/2011 , 50.00
1234 , 03/01/2011 , 52.00
1234 , 06/01/2011 , 55.00
I need to be able to get the Next Value of the effective date in order to calculate the pay amount for the date range. So for the first record, I would need to be able to get the start date of 3/1/2011, so I could calculate the pay between the days of 1/1/2011 and 2/28/2011. I can get the next start date of 3/1/2011 fine, but the problem is I can't perform any running totals or aggregate functions.
Any other ideas?