Solved

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

Posted on 2014-02-16
3
481 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 40

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 40

Expert Comment

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

679 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