SQL Server view: how to add missing rows using interpolation
- by Christopher Klein
Running into a problem.
I have a table defined to hold the values of the daily treasury yield curve.
It's a pretty simple table used for historical lookup of values.
There are notibly some gaps in the table on year 4, 6, 8, 9, 11-19 and 21-29.
The formula is pretty simple in that to calculate year 4 it's 0.5*Year3Value + 0.5*Year5Value.
The problem is how can I write a VIEW that can return the missing years?
I could probably do it in a stored procedure but the end result needs to be a view.