Count Date Row 10 1/1/2013 1 10 1/2/2013 2 10 1/3/2013 3
Sum Date 10 1/1/2013 20 1/2/2013 30 1/3/2013
declare @count int declare @i int set @i = 1 set @count = (select max(Row) from #test) -- equals to 3 while @i <= @count begin select sum(Count) as SumCount , Date from #test where row between 1 and @i group by Date set @i = @i + 1 end
SumCount Date 10 1/1/2013 10 1/2/2013 10 1/3/2013
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)