?
Solved

Access 07 - Cumul Sum field in a Query - Time to process concern

Posted on 2014-02-16
3
Medium Priority
?
493 Views
Last Modified: 2014-02-16
Hello all,

Well I've posted questions in the past trying to get a query to add a cumulative sum field within a query.

Cap1 always can do this in 1 query.... It takes me 3 queries to get to the same result but at least I was able to FINALLY get there.

I'm attaching a db only has 4 tables and the 3 queries.  The 4 tables have maybe 50 total records.

The ultimate result that I need is what is in qry_CumulSum_step3 but to get there I had to do qry_CumulSum first then qry_CumulSum_step2.

My concern here is when I open qry_CumulSum_step3 it takes too long for there only being 31 records.

So.... what will happen when I have 5,000 or 10,000 records...........

Any suggestions to speed this process up would be appreciated.

My code for the step3 query is
SELECT qry_CumulSum_Step2.ShiftID, qry_CumulSum_Step2.BusDay, qry_CumulSum_Step2.CashFdActID, qry_CumulSum_Step2.TransAmtTtl, Val(DSum("TransAmtTtl","qry_CumulSum_Step2","ShiftID <=" & [a].[ShiftID])) AS y
FROM qry_CumulSum_Step2 INNER JOIN qry_CumulSum_Step2 AS a ON (qry_CumulSum_Step2.BusDay = a.BusDay) AND (qry_CumulSum_Step2.ShiftID = a.ShiftID);

Open in new window

EE-Cumulative-Sum-Q.accdb
0
Comment
Question by:wlwebb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
als315 earned 2000 total points
ID: 39862437
You can increase calculation speed if you remove dsum from first query. I don't understand why you need it there. Dsum always take a lot of time, try to use it only in last step
0
 

Author Closing Comment

by:wlwebb
ID: 39862443
It was where I started.......  I just tried to get it to do a cumulative sum on anything... I was grasping at straws at that point ;-((   I should have removed it I agree...  

When I did your suggestion it did in fact increase query step 3....

Thank you Als!!!
0
 
LVL 40

Expert Comment

by:als315
ID: 39862520
Look at this sample with 2 queries also
EE-Cumulative-Sum-Q1.accdb
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question