Solved

Access 07 - Query - Cumulative By Each Day AND By 2 Other Criteria

Posted on 2014-02-16
4
226 Views
Last Modified: 2014-02-22
Hello all

Trying to soak all this in and going to next level thanks to all of you!

Had a lot of help today by Als315 getting me to be able to get a cumulative column calculating correctly and A LOT quicker than what I was trying to do...

Now I have a perplexing problem.

With that same background that I want it getting a cumulative field by Each Day as of the end of Each Shift I now would like to figure out how to get it to accumulate Each Day's Total as of the end of Each Shift AND FOR EACH TRANSTYPE.

Als315 showed me the qry_Cumul and Cumul0.  From that I am attempting to further refine query.

I created a qry_CumulByTranType that Inserts a TTypeID of 0 for each shift if there isn't any TransTypeID for that Shift (to avoid Null fields)

THEN....

Trying to get it to Sum Each Day at the End of Each Shift BY THAT TTypeID so that if, for example, Jan 2nd had 3 shifts and shift 1 of the day had NO Transactions of any type and Shift 2 had a TransTypeID of 6 and Shift 3 had a TransTypeID of 7 The cumulative result for my query for Jan 2nd would be:

Shift 1:
TType0 - CumulTAmt=0

Shift2:
TType6 - CumulTAmt=5685.55

Shift3:
TType6 - CumulTAmt=5685.55
TType7 -CumulTAmt=1789.96

In subsequent shifts for each Day if the ONLY TType in that Shift is 0 I would want it ignored.  But if the Preceeding Shift and the Current Shift both a 0 then the Current shift record should be TType 0.

Is this even possible?????
EE-Cumulative-Sum-ByType.accdb
0
Comment
Question by:wlwebb
  • 3
4 Comments
 
LVL 30

Expert Comment

by:hnasr
ID: 39863916
Until the previous helper can come to stage, I expect one query/table holding the columns to carry on.

So try to specify which query/table to look use.

Try to exclude all other irrelevant fields to this issue, then upload the database.
0
 

Author Comment

by:wlwebb
ID: 39864903
hnasr..

I thought i did:
I created a qry_CumulByTranType that Inserts a TTypeID of 0 for each shift if there isn't any TransTypeID for that Shift (to avoid Null fields)

(I left Als315's querys there so I wouldn't lose them and could refer back for my education)

That query feeds my "attempt" in query
qry_CumulByDayByTransTypeForDay which was my feeble attempt at trying to get it to do a Cumulative Sum column for EACH Shift & BusDay & TTypeID
0
 

Accepted Solution

by:
wlwebb earned 0 total points
ID: 39864992
NEVER MIND.........

I missed an " AND " in my final criteria which is why my result was #Error.
0
 

Author Closing Comment

by:wlwebb
ID: 39879017
Moderator please close & or delete
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

861 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