I have a simple query:
Select
fiscalweek, 4171
From table
And I get results in order of fiscal week:
FiscalWeek 4171
1 691
2 746
3 650
4 625
5 788
6 581
7 597
8 772
9 777
I want in a third column, the sum of the previous 6 fiscal weeks, or for week 2 just the sum of weeks 1 & 2,
so the out put would be:
FiscalWeek 4171 Sum
1 691 691
2 746 1437
3 650 2087
4 625 2712
5 788 7671
6 581 4081
7 597 3393
8 772 4013
9 777 4140
I have tried using rows unbounded preceeding
but this was not available on 2008, any suggestions ?