Hi Tom Or I should re-phrase as below:- 1st transaction:- Credited 20 & debited 10 on 1Jan2014 transaction look alike:- Date Credit Debit Balance Credit Balance 1Jan2014 20 10 10 10 2nd Transaction :- Debited 5 on 5Jan2014 transaction look alike:- Date Credit Debit Balance Credit Balance 1Jan2014 20 10 10 10 5 (Balance left only 5 due to second debit transaction) 5Jan2014 0 5 5 0 3rd Transaction :- Credited 30 on 15Jan2014 transaction look alike:- Date Credit Debit Balance Credit Balance 1Jan2014 20 10 10 5 (Balance remain as the 3rd transaction was not debit transaction) 5Jan2014 0 5 5 0 15Jan2014 30 0 35 30 (Balance for this new credit transaction) Assuming the new transaction come in, 4th transaction:- Debited 15 on 20Jan2014 transaction look alike:- Date Credit Debit Balance Credit Balance 1Jan2014 20 10 10 5 0 (The new debit transaction of 15 take from the this balance 1st) 5Jan2014 0 5 5 0 15Jan2014 30 0 35 30 20 (The balance of the new debit transaction 10, (15-5) will deduct from this transaction as the previous transaction had already become 0) 20Jan2014 0 15 20 0 In summary, whenever there is a new debit transaction comes in, it will deduct from the what ever is left on previous credit balance 1st base on FIFO logic. by end of the day, the latest 'Balance' value, which is here is 20 have to be equal to sum of all 'Credit balance' Not sure this will make things even complicated? :smileyconfused:
... View more