Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How do calculate a running total (such as a bank balance) in a table box?
I would like to calculate the running total for the following bank file
No Detail Amount
1 Start balance 10
2 Deposited 5
3 Withdrawn -2
to get the following Table Box:
No Detail Amount Balance
1 Start balance 10 10
2 Deposited 5 15
3 Withdrawn -2 13
If have tried to use the following
SELECT
`BankNo` As 'No',
`BankDetail` As 'Detail',
`BankAmount` As 'Amount',
`Amount` + Previous(`Amount`) As 'Balance'
FROM `db`.`bank` AS `bank`
but I get the error message Function Previous does not exist?
Thanks a lot. I eventually managed it
Thanks a lot. I eventually managed it
Thanks a lot. I eventually managed it
jannielouw, please mark as answered so that we close this discussion.
Thnak you.
There is an example in the QV manual that I have used
Under peek
load
A,
B,
numsum(B,PEEK('BSUM')) AS BSUM ...
creates an accumulation of B in BSUM
This might also work
Thanks. I did get the previous example going