• Hi Luiz, I just posted the ddl as a guide, the values may not be 100%, should of fine tuned them before posting,have no access at this exact time.Basically its the actual case statement im concerned with , I don't know if the actual logic within the sql is correct or if a case statement is even the right way to actually achieve a result, is there another way of doing it?

    TYPE UNITNR PLATENR TYPE_FLEET VALUE START-DATE END_DATE DATE_BLOCKED VEHICLE_DEPRECIATION_VALUE DEPR

    For Sale | 28 | 08D12345 | OF | 10674.18 | 2008-02-29 | 2012-02-29 | 2012-07-24 | 112.47 | 5511.03

    For Sale | 28 | 08D12345 | OF | 10674.18 | 2012-03-01 | 2012-08-30 | 2012-07-24 | 508.61 | 2543.05

    here is what i need

    TYPE| UNITNR| PLATENR| TYPE_FLEET| VALUE| DATE_BLOCKED | DEPR

    For Sale| 28| 08D12345 |OF| 10674.18| 2012-07-24 112.47| 7938

    The key figure here is the result DEPR 7938 .This number comes from the first period of depreciation 2008-02-29 to 2012-02-29 is 48 months which is then * 112.47 this equals 5398. This figure is added to the second period of depreciation 2012-03-01 to (2012-07-24(date vehicle blocked for sale) which is 2540. This adds up to 7938

    This is where I need to get to, so anything that can keep me moving is appreciated.