Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-02-16
4
Medium Priority
?
232 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
[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
  • 3
4 Comments
 
LVL 31

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

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.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

636 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