I need some help processing this source data to return the relative amount between dates. For example difference between 03/12/04 and 03/14/05 is -1.755.00 - easy enough but the date to return is 03/12/04. I am struggling to do this neatly without using lots of temporary tables.

The only exception is the last payment which needs to remain the same. This is easy to do but I would like some guidance with the problem above. For info the result set total is equal to the first source data amount.

Thanks.

SOURCE DATA RESULT SET
StartDate Amount Date Amount
03/12/04 -95,339.60 03/12/04 -1,755.00
03/14/05 -93,584.60 03/14/05 -3,471.40
03/14/06 -90,113.20 03/14/06 -3,494.60
03/14/07 -86,618.60 03/14/07 -3,821.10
03/14/08 -82,797.50 03/14/08 -5,074.70
03/13/09 -77,722.80 03/13/09 -5,287.40
03/12/10 -72,435.40 03/12/10 -5,436.50
03/14/11 -66,998.90 03/14/11 -6,929.60
03/14/12 -60,069.30 03/14/12 -7,714.90
03/14/13 -52,354.40 03/14/13 -8,434.70
03/14/14 -43,919.70 03/14/14 -9,473.30
03/13/15 -34,446.40 03/13/15 -10,172.10
03/14/16 -24,274.30 03/14/16 -11,613.20
03/14/17 -12,661.10 03/14/17 -12,661.10