473,396 Members | 1,832 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.

Report total... from a GROUP level

Hey All,

I have a report based on a query that joins a 'parent' and 'child'
table.
Each row in the query corresponds to a row in the child table, with a
few fields from the Parent table.

At the bottom of the report, in the footer, I total some values from
the Child table.

I also have a group by for each Parent record.

I want to get a SUM for one of the Parent fields (which is shown in a
group by header).

So if I have 2 parent records, with 3 child records each, I want to sum
Parent.age over the two parent records.

How do I do that?

Thanks for any ideas!

Joe

Dec 21 '06 #1
2 2511
Hi Joe,

Try using a subreport - or 2 subreports. A subreport is just a report
within a report. YOu can do your detail stuff in one subreport and the
cumulative query in the 2nd subreport. That is one idea, probably the
hard way to do it.

something a little easier might be to to include your detail data and
sum data in the same table/query:

Select * from
((select detail stuff) Union All (Select Sum stuff)) t1

Note: when you do a

select * from (Select * from tbl1 where something) t1

You have to alias the contents within the Parentheses (...) with
something like t1 or xyz or Steve... give the (select *...) a name - the
alias.

Just some ideas.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Dec 21 '06 #2
Rich,

Thanks for the ideas.

I should have mentioned, I already have a report with a sub-report.

Within the subreport, I have the Parent and Child query.

Within the subreport I sum child fields ( the sum values are shown in
the report footer section). I also display these sum values on the
main report.

The problem is that in the sub report... I have a "group by" section
(which is grouped on one of the Parent fields), and what I want (in the
end) is to SUM one of the parent fields at the end of the subreport.

The problem is the parent field does not appear in the DETAIL section
of the subreport, so I can't do a sum on it.

Is there some way to do a sum on fields in the Group by section?

Thanks,
Joe

Rich P wrote:
Hi Joe,

Try using a subreport - or 2 subreports. A subreport is just a report
within a report. YOu can do your detail stuff in one subreport and the
cumulative query in the 2nd subreport. That is one idea, probably the
hard way to do it.

something a little easier might be to to include your detail data and
sum data in the same table/query:

Select * from
((select detail stuff) Union All (Select Sum stuff)) t1

Note: when you do a

select * from (Select * from tbl1 where something) t1

You have to alias the contents within the Parentheses (...) with
something like t1 or xyz or Steve... give the (select *...) a name - the
alias.

Just some ideas.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Dec 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Darren | last post by:
I have a report with one level of grouping and a running sum field in the detail section of the report. When I make the running sum field visible, I can see that it increases the count by 1 for...
2
by: Hohn Upshew | last post by:
I need some help to build a report enumerating the products in descending order depending on the sum of liters. In this way i can view the top products sold for a given period.But i fail to do...
1
by: Nothing | last post by:
I have a report that has several groups on it. I want to total for each group. My problem is that I group by a name and under the name I have data that breaks out into several sub-groups for that...
3
by: Miguelito Bain | last post by:
hi- i have a simple table. i have 3 fields, id, indate, and outdate. i want to group these fields in my report by month. for example, for february 2004, i want to display all the ids and dates...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
3
by: Pecanfan | last post by:
Hi, I've got an access report which contains a sub-report. The sub-report contains various items in a group Footer which culminates in a running sum text box called txtGrandTotal. I want to...
7
by: SueB | last post by:
Greetings. I have a report based on the following query (hang in there ... it's quite long): SELECT Year(.) AS Yr, tblEvents.eventID, tblEvents.eventname, tblEvents.eventhost,...
4
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.