SQL Server Interpolate Missing rows
I have the following table which records a value per day. The problem is that sometimes days are missing. I want to write a SQL query that will: Return the missing days Calculate the missing value using linear interpolation So from the following source table: Date Value -------------------- 2010/01/10 10 2010/01/11 15 2010/01/13 25 2010/01/16 40 I want to return: Date Value -------------------- 2010/01/10 10 2010/01/11 15 2010/01/12 20 2010/01/13 25 2010/01/14 30 2010/01/15 35 2010/01/16 40 Any help would be greatly appreciated. declare @MaxDate date declare @MinDate date select @MaxDate = MAX