Bill,
I mocked up some data and created a query. I hope it's helpful.
The data table (EagleBill)
id |
tranDate |
Credit |
Debit |
1 |
02/11/2015 |
$100.00 |
|
2 |
02/11/2015 |
$200.00 |
|
3 |
03/11/2015 |
|
$100.00 |
4 |
04/11/2015 |
$300.00 |
|
5 |
06/11/2015 |
$400.00 |
|
6 |
06/11/2015 |
|
$300.00 |
7 |
07/11/2015 |
|
$200.00 |
8 |
08/11/2015 |
$200.00 |
|
The query
Code:
SELECT eaglebill.id
,Credit
,Debit
,Format(DSum("Nz(Credit,0) - NZ(Debit,0)", "eaglebill", "ID<=" & ID), "Currency") AS RunningBalance
FROM eaglebill
The result:
id |
Credit |
Debit |
RunningBalance |
1 |
$100.00 |
|
$100.00 |
2 |
$200.00 |
|
$300.00 |
3 |
|
$100.00 |
$200.00 |
4 |
$300.00 |
|
$500.00 |
5 |
$400.00 |
|
$900.00 |
6 |
|
$300.00 |
$600.00 |
7 |
|
$200.00 |
$400.00 |
8 |
$200.00 |
|
$600.00 |
Good luck.
After posting, I realized I didn't include TranDate (I didn't use it but thought I should show it in the output)
revised query
Code:
SELECT eaglebill.id
,TranDate
,Credit
,Debit
,Format(DSum("Nz(Credit,0) - NZ(Debit,0)", "eaglebill", "ID<=" & ID), "Currency") AS RunningBalance
FROM eaglebill
ORDER BY ID
Output with the Trandate
Code:
id |
TranDate |
Credit |
Debit |
RunningBalance |
1 |
02/11/2015 |
$100.00 |
|
$100.00 |
2 |
02/11/2015 |
$200.00 |
|
$300.00 |
3 |
03/11/2015 |
|
$100.00 |
$200.00 |
4 |
04/11/2015 |
$300.00 |
|
$500.00 |
5 |
06/11/2015 |
$400.00 |
|
$900.00 |
6 |
06/11/2015 |
|
$300.00 |
$600.00 |
7 |
07/11/2015 |
|
$200.00 |
$400.00 |
8 |
08/11/2015 |
$200.00 |
|
$600.00 |