Solved

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

Posted on 2014-02-16
3
474 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
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
als315 earned 500 total points
Comment Utility
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
Comment Utility
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 39

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now