Cumulative Total in a Query

G

Guest

I am building a database to act like a bank account statement. I have a query
(called Daily Credit Debit) which total all of the transactions on each day.
I want to create another query (rather than a report) that will provide a
cumulative total of the daily credits and debits. I've got this...

SELECT [Daily Credit Debit].Date, [Daily Credit Debit].SumOfExpr2,
Format(DSum([SumOfExpr2],"[Daily Credit Debit]","[date]<=" & [Daily Credit
Debit].date),"Currency") AS Balance
FROM [Daily Credit Debit];

....but it gives me blanks.
I think the problem is in the criteria to total upto and including the date
of the current record.

any suggestions.

Thanks,
Robbie
 
G

Guest

I've added # delimiters and now get just one number halfway down the column.

SELECT [Daily Credit Debit].Date, [Daily Credit Debit].SumOfExpr2,
Format(DSum([SumOfExpr2],"[Daily Credit Debit]","[Date]<= #" & [Daily Credit
Debit].Date & "#"),"Currency") AS Balance
FROM [Daily Credit Debit];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top