DateId Date Id 1 2013-06-01 00:00:00.000 1 2 2013-07-05 00:00:00.000 1 3 2013-08-08 00:00:00.000 1 4 2013-09-10 00:00:00.000 1
SELECT *, (SELECT DateDiff(DD,a.[Date],SUM(b.[Date])) FROM [dbo].[Date] b WHERE b.[DateId] <= a.[DateId]) as DateSum FROM [dbo].[Date] a ORDER BY a.[DateId];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)