>>The table has 3 columns:
>>depositamout (decimal)
>>trantype char(3) - can be 'DEP' (deposit) or 'CPU' (carrier pickup)
>>trandate datetime
>>
>>I want to write a query that returns the the date associated with the carrier pickup and the sum of the deposits that occurred since the date of the previous carrier pickup, including those of the carrier pickup date.
>>
>>Any help greatly appreciated.
>
>Could you please post some example data and desired result?
Sample data
2019-11-05 00:00:00.000 DEP 5743.00
2019-11-06 00:00:00.000 DEP 5158.00
2019-11-07 00:00:00.000 CPU 0.00
2019-11-07 00:00:00.000 DEP 5636.00
2019-11-08 00:00:00.000 DEP 5515.00
2019-11-09 00:00:00.000 DEP 5108.00
2019-11-10 00:00:00.000 DEP 5818.00
2019-11-11 00:00:00.000 CPU 0.00
2019-11-11 00:00:00.000 DEP 3217.00
Desired result
2019-11-07 00:00:00.000 16537.00
2019-11-11 00:00:00.000 19658.00
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.