[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Calculating a running balance



The following snippet could work for you.

  move 100 to #Balance
  print 'Beginning Balance' (+1,1)
  print #Balance (+0,40) edit 999,999.99
begin-select
A.Amount
  add &A.Amount to #Balance
  move &A.Amount to #Amount
  print $Amount (+1,1) edit 999,999.99
  print #Balance (+0,40) edit 999,999.99
from  Debit_Credit_Table
end-select
  print 'Ending Balance' (+1,1)
  print #Balance (+0,40)


David Anderson
Compuware Professional Services
Oakwood Health Services - Muirhead