?
Solved

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

Posted on 2014-02-16
4
Medium Priority
?
230 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 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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