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.