If you're determined to do it in a query (I would not recommend it because as your database grows it may become quite unmanageable), make SURE you limit the results of the query to ONLY the person /account/whatever you can, the smaller your dataset the easier it will be
example:
tblActivity
PK |
DateField |
AmountField |
1 |
1/1/2015 |
$5.00 |
2 |
1/2/2015 |
$10.00 |
3 |
1/3/2015 |
($7.50) |
4 |
1/4/2015 |
$14.00 |
5 |
1/5/2015 |
($5.00) |
Query with running sums:
Code:
SELECT tblActivity.PK, tblActivity.DateField, tblActivity.AmountField, DSum("[AmountField]","tblActivity","[Datefield] <= #" & [datefield] & "#") AS RunSum
FROM tblActivity;