troubleshooting Question

How to create a running sum in an Access query

Avatar of Liberty4all
Liberty4allFlag for United States of America asked on
Microsoft AccessSQLPower BI
14 Comments1 Solution129 ViewsLast Modified:
I want to create a running sum in an Access query that calculates daily cumulative totals.  The fields I'm using are Date, Month, Year, and Total.  The Total field (column) contains the daily account balance changes (positive or negative) for each day, and these are to be reflected in the running sum total.  The table name is tblAcctBalAllFunds_CFYTD.

I've tried the following Dsum statements which produce either blank or incorrect results so I'm guessing I don't have the syntax correct.

DSum("Total","tblAcctBalAllFunds_CFYTD","Date<=" & [Date]) - produces blank results

DSum("Total","tblAcctBalAllFunds_CFYTD","Date<=" & [Adate] & "") - produces blank results (Adate is an alias for Date)

DSum("Total","tblAcctBalAllFunds_CFYTD","DatePart('m', [Date])<=" & [AMonth] & " And DatePart('yyyy', [Date])<=" & [AYear] & "") - produces incorrect results (AMonth and AYear are aliases for Month and Year)

Any suggestions on what to try next would be appreciated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros