C
|
clig 2/1/2010 |
Hi all Is it possible to have a "running total" in an access table in ASPR 5.2 ? But I don't want to store the running total in the table itself. Table Transactions: CustomerID TransactionsID TransactionsDate TransactionsType TransactionsReference TransactionsMoneyIn TransactionsMoneyOut I have been looking with DSum, but don't have a clue of how to implement it and where to implement it. Any help would be appreciated. Many thanks Maurits
|
M
|
Maurits author 2/1/2010 |
So far I got: |
C
|
clig 2/2/2010 |
So far I got: SELECT '', DSum("[Transactions.TransactionMoneyIn]" - "[Transactions.TransactionMoneyOut]","Transactions","[Transactions.CustomerID]<=" & [CustomerID] & "") AS RunTotal FROM Transactions GROUP BY Transactions.TransactionDate But if I put this in the SQL query editor, it comes up with error messages. In normal human words: Click on Master-Detail, click Account then SELECT DSUM (moneyIn - moneyOut) from table Transactions WHERE CustomerID=Variable and ORDER TransactionDate What it should do is and show on the View page is (Like a bank statement): CustomerID Date Type Reference MoneyIN MoneyOut RunningTotal 1 11/12 Cre Start 100.00 100.00 1 11/12 Cre Credit 200.00 300.00 2 01/12 Cre Start 200.00 not shown 2 01/12 Deb Refund 50.00 not shown 1 15/12 Deb Pay out 50.00 250.00 It should only show records with the CustomerID=1 with a total running, but this total may not be stored in the database. Please I need help with this code and also how do you implement this into the Custom Table View?
|