Viewing 3 posts - 1 through 3 (of 3 total)
Thanks, Todd!
October 11, 2010 at 1:36 am
#1234808
Oh, i've missed 5-year condition... :crying:
October 7, 2010 at 2:53 am
#1233321
SELECT t1.EmployeeID
,t1.DataYear
,t1.YearlyWage
,t3.total
FROM @MyTable t1
CROSS APPLY (SELECT SUM(t2.YearlyWage) AS Total
FROM @MyTable t2
WHERE t2.EmployeeID = t1.EmployeeID
AND t2.DataYear < = t1.DataYear
GROUP BY t2.EmployeeID) ...
October 7, 2010 at 2:50 am
#1233320