b.eurika84 Posted April 3, 2013 Share Posted April 3, 2013 I have the query result like thisTransactionDate Amount Debit/Credit StartingBalanceToday-------------------------------------------------------------------------2013-03-01 1000 C 1000 2013-03-01 100 D 1000 2013-03-01 200 D 1000 then i want to add new column "Balance" in the report like this TransactionDate Amount Debit/Credit StartingBalanceToday Balance-------------------------------------------------------------------------------------2013-03-01 1000 C 1000 2000 2013-03-01 100 D 1000 19002013-03-01 200 D 1000 1700"Debit/Credit" column determines whether the calculation is ADD or SUBSTRACT. If "Debit/Credit" is "C" then the calculation is ADD, otherwise "Debit/Credit" is "D" then the calculation is SUBSTRACTthe formula for new column "Balance" -----> Balance = StartingBalanceToday -/+ Amountthen for the next "Balance" -----> Balance = Previous Balance -/+ Amountnb: Previous Balance is the value of previous "Balance"how can I solve this problem? I have tried to use variable BALANCE to store the formula Balance = Previous Balance -/+ Amountbut I dont know how to acces the previous variablePlease help :)Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now