J
John
Trying to make a running sum query using DSUM. I've looked at the sample from
rogersaccesslibrary.com and searched google. My problem is that when I try to
Group By using AcctNumber, I get the same thing in all records, which is the
overall total of all records, rather than running sum for each AcctNumber.
AcctNumber is text, not numeric.
SELECT tblTransactions.TransActID, tblTransactions.AcctNumber,
tblTransactions.Amount, tblTransactions.Description,
DSum("Amount","tblTransactions","[AcctNumber]='" & [AcctNumber] & "'" And "
TransactID <=" & [tblTransactions].[TransactID]) AS RunningBalance
FROM tblTransactions
ORDER BY tblTransactions.TransActID;
When I don't try to Group By AcctNumber, it works as expected, in other words,
the running sum is working on TransactID:
SELECT tblTransactions.TransActID, tblTransactions.AcctNumber,
tblTransactions.Amount, tblTransactions.Description,
DSum("Amount","tblTransactions"," TransactID <=" &
[tblTransactions].[TransactID]) AS RunningBalance
FROM tblTransactions
ORDER BY tblTransactions.TransActID;
How can I get it to group on AcctNumber (which is text)?
Thanks
rogersaccesslibrary.com and searched google. My problem is that when I try to
Group By using AcctNumber, I get the same thing in all records, which is the
overall total of all records, rather than running sum for each AcctNumber.
AcctNumber is text, not numeric.
SELECT tblTransactions.TransActID, tblTransactions.AcctNumber,
tblTransactions.Amount, tblTransactions.Description,
DSum("Amount","tblTransactions","[AcctNumber]='" & [AcctNumber] & "'" And "
TransactID <=" & [tblTransactions].[TransactID]) AS RunningBalance
FROM tblTransactions
ORDER BY tblTransactions.TransActID;
When I don't try to Group By AcctNumber, it works as expected, in other words,
the running sum is working on TransactID:
SELECT tblTransactions.TransActID, tblTransactions.AcctNumber,
tblTransactions.Amount, tblTransactions.Description,
DSum("Amount","tblTransactions"," TransactID <=" &
[tblTransactions].[TransactID]) AS RunningBalance
FROM tblTransactions
ORDER BY tblTransactions.TransActID;
How can I get it to group on AcctNumber (which is text)?
Thanks