Date data prevdaydata 15/2/2015 20 0 16/2/2015 50 20 17/2/2015 90 50 18/2/2015 120 90 19/2/2015 140 120
SELECT t1.Date, t1.data, COALESCE(t2.Data,0) As prevdata FROM TableName AS t1 LEFT JOIN ( SELECT DateAdd(dd, 1, Date) As [Date], data FROM TableName )AS t2 ON t1.Date = t2.Date
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)