473,396 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Running Total in query

I have a table with four columns :

Autonumber ProductGroup Amount Date

The table consists of transactions for different dates . The dates are already sorted . But I am having a problem in getting the running total for each product group. I need the running total for every date for each product group. When the product group changes then a new running total is required.
Please assist as I have not been able to find a solution so far.
Thanks
Aug 21 '11 #1

✓ answered by Vish Narayan

No issues. A friend suggested the following method to get the running total in a cross tab report. I was told to create a record ID for each item in the source table and obtain the running total in the query . Hence managed to get the running totals per product group.The records were already sorted by product group and transaction date. For those months where no transactions existed for some product groups, I created a "missing months query" and appended to the main transactions table .Another query was created that identified the Max of record Id for each ProductGroup. This way I was able to get the running total balance for each month for the last date for each Group. The report was then an easy task.

8 2655
NeoPa
32,556 Expert Mod 16PB
May I ask why you believe you need this facility in the query?

The reason I ask is because such a facility is provided as standard in reports and forms, where it makes most sense they be used, but doing so in a query makes little sense generally and is also quite complicated to produce (involving subqueries as it does). Running such a query would also be much less efficient due to that point too of course.
Aug 21 '11 #2
I have a cross tab report and would like to use this query as the source to get the month end balances for balance sheet accounts like Tr ade receivables and Trade payables under the respective months in the report. Is there any other way to get the balances at the end of each month displayed in a cross tab report under the respective months?
Aug 22 '11 #3
NeoPa
32,556 Expert Mod 16PB
I never play with Cross-Tab queries, but Report Controls have a property that handles running sums for you. I would say it is entirely unnecessary for the query to handle it.
Aug 22 '11 #4
Can you please give me an example of how to get the running total in a crosstab report for just two months say Jan and Feb for the monthend closing balances?
Aug 23 '11 #5
NeoPa
32,556 Expert Mod 16PB
No. Your question doesn't even provide enough information to make that really possible, but mainly because you need to do some of the work yourself. I have already pointed you in the right direction. All you need to do now is look and you will find.
Aug 23 '11 #6
I am aware that report controls have the running total "overgroups possibility. I am only asking if this also applies to a cross tab report. If you are unable to show an example its fine. I was posting my question as I have seen great solutions being provided in this forum to many complicated queries which the member having tried from all angles still did not manage. We do not run to the forum without making an effort first. Thanks for your support.
Aug 25 '11 #7
NeoPa
32,556 Expert Mod 16PB
Vish Naryan:
I am aware that report controls have the running total over groups possibility. I am only asking if this also applies to a cross tab report.
It may have helped to make that clearer earlier, but communication is always hard when dealing with language, especially a fundamentally foreign one, so no complaints there. Now that is clear, I have to admit that, though I'd like to help, I don't have the relevant experience as I never use Cross-tabs myself (See comment in post #4). I would only be creating something from scratch just to look into what you already have available to see.

I appreciate your attitude is fine and you weren't, like some members, posting as your first response to anything remotely new or confusing, but that was only made clear after your last post, so please excuse me for any misunderstanding. Please remember next time though, the rules do indicate that you should show what work you've already done in your question post. This avoids any confusion between posters such as yourself and those who are just here to get others to do all their work for them.
Aug 25 '11 #8
No issues. A friend suggested the following method to get the running total in a cross tab report. I was told to create a record ID for each item in the source table and obtain the running total in the query . Hence managed to get the running totals per product group.The records were already sorted by product group and transaction date. For those months where no transactions existed for some product groups, I created a "missing months query" and appended to the main transactions table .Another query was created that identified the Max of record Id for each ProductGroup. This way I was able to get the running total balance for each month for the last date for each Group. The report was then an easy task.
Aug 26 '11 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Stephen Miller | last post by:
Hi, I am trying to add a staggered running total and average to a query returning quarterly CPI data. I need to add 4 quarterly data points together to calculate a moving 12-month sum (YrCPI),...
4
by: Bill Dika | last post by:
Hi I am trying to calculate a running total of a calculated textbox (tbAtStandard) in GroupFooter1 for placement in a textbox (tbTotalAtStandard) on my report in Groupfooter0. The problem...
1
by: ????? | last post by:
I have a query which shows the following fields and orders by every one in turn from left to right in ascending order. The fields are DATE, , WORK, *, DESCRIPTION and . How can I get a running...
1
by: u473 | last post by:
I am scratching my head with the required quotes and parentheses. I started with an existing working Query with Running Total by date. Now I need to produce a running total by quarter day, so I...
16
by: Gandalf186 | last post by:
I need to create a query that produces running totals for every group within my table for example i wish to see: - Group A 1 5 9 15 Group B
2
by: Jana | last post by:
Using Access 97. Background: I have a main report called rptTrustHeader with a subreport rptTrustDetails in the Details section of the main report. The main report is grouped by MasterClientID. ...
12
jaccess
by: jaccess | last post by:
Hello all, I am trying to create a running total based on a specific date range that is to be entered into a form. I currently have the form set up with 2 text boxes (date1 and date2) which are...
9
by: JJM0926 | last post by:
I'm trying to create a running totals query in access 97. I have followed the directions on how to do it from Microsofts website article id 138911. I took their code they had and replaced it with...
6
by: Stuart Shay | last post by:
Hello All: I have a array which contains the totals for each month and from this array I want to get a running total for each month decimal month = new decimal; month = 254; (Jan) month =...
2
by: Gelcys | last post by:
I feel as though I’m banging my head against a wall trying to get something done – Access is good at some parts and Excel at others. What I’m starting with is a txt file that I need to import weekly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.