Calculated value(derived column)for next row

Database
Enthusiast

Calculated value(derived column)for next row

col1          col2 col3   col 4   calculatedcolumn

201301      1      ?      ?           ?

201302       1    ?       ?           ?

201303       1   4.5      3        4.5*12+3(col4) so my value is 57

201304       1    ?        2            57*12+2           686  

201305      1      ?       5          686*12+5        8237

201301    2       ?         1              ?   

201302    2       3.1      2          3.1*12+1

if value present in col3 then use that value for calculated field and use perivious calculated value for next week(next row till combination of col1 and col2 ) please help me ,it may  procedure or query anything

Tags (1)