SQL Server view: how to add missing rows using interpolation
        Posted  
        
            by Christopher Klein
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Christopher Klein
        
        
        
        Published on 2009-05-28T13:15:09Z
        Indexed on 
            2010/04/06
            20:03 UTC
        
        
        Read the original article
        Hit count: 416
        
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.
© Stack Overflow or respective owner