Basic cumulative totals etc with T-SQL
Very often when writing reports or dealing with time data you’ll come across the need to see what the total at that point was, not the grand total of all data, just total up to (and maybe including that point). Lets start with a basic set of data declare @testtable as table (i datetime,v int)…