I have to generate an extract in the database that is similar to the bank statement and present the cumulative balance.
I have the following columns
Data, Debito, Crédito.
Data entry is daily but the statement I need is per month.
01/01/2015 – Credito 100
02/01/2015 – Débido 30
02/01/2015 – credito 70
01/02/2015 – debito 50
01/02/2015 – credito 80
02/02/2015 – debito 20
01/03/2015 – credito 60
01/03/2015 – debito 20
data debito credito saldo
01/01/2015 100 100
02/01/2015 30 70
02/01/2015 70 140
01/02/2015 50 90
01/02/2015 80 170
01/02/2015 20 150
01/03/2015 60 210
01/03/2015 20 190
The result should be:
data debito credito saldo
jan 30 170 140
fev 70 80 150
mar 20 60 190