Solved

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

Posted on 2014-02-16
3
477 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
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 39

Expert Comment

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

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

912 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

22 Experts available now in Live!

Get 1:1 Help Now