473,465 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HOW TO: Summary Page for Month-by-Month Report

I've built a report using a aggregate query that is grouped by Month +
Year, Program and Name. When I feed the date ranges as query
parameters, it will very properly print out a report that shows a
separate page for each program by month with the names of the folks in
that program. So far, so good... But what I need to complete the
report is a summary page for the entire date range in the same format.
I have no &%^# idea how to do that.

Do I have to fire off a separate report using the same parameters from
an event in the month-by-month report, or is there an easier way? Can
anyone help me (with this problem...the rest of me is beyond help)?

If anyone's feeling particularly masochistic, the SQL statement is
included below.

TIA

Neill Dumont

==
SELECT tblCharges.month_yr, tblCharges.program, [last]+", "+[first] AS
Name, Sum(IIf([professional],[hours],0)) AS Prof,
Sum(IIf([unduplicated],1,0)) AS [1st Time],
Sum(IIf([gender]="Male",[hours],0)) AS Male,
Sum(IIf([gender]="Female",[hours],0)) AS Female, Sum(IIf(age([dob])
Between 6 And 17,[hours],0)) AS [6-17], Sum(IIf(age([dob]) Between 18
And 29,[hours],0)) AS [18-29], Sum(IIf(age([dob]) Between 30 And
65,[hours],0)) AS [30-65], Sum(IIf(age([dob])>65,[hours],0)) AS [65+],
Sum(IIf([ethnicity]="White",[hours],0)) AS White,
Sum(IIf([ethnicity]="Black",[hours],0)) AS Black,
Sum(IIf([ethnicity]="Hispanic",[hours],0)) AS Hispanic,
Sum(IIf([ethnicity]="Asian",[hours],0)) AS Asian,
Sum(IIf([ethnicity]="Native American",[hours],0)) AS NatAm,
Sum(IIf([ethnicity]="Other",[hours],0)) AS Other,
Sum(IIf([hours]>0,[hours],0)) AS TotHours
FROM tblVolunteers RIGHT JOIN tblCharges ON tblVolunteers.vol_id =
tblCharges.vol_id
WHERE (((tblCharges.month_yr) Between
[Forms]![frmSetReportRange]![txtStart] And
[Forms]![frmSetReportRange]![txtEnd]))
GROUP BY tblCharges.month_yr, tblCharges.program, [last]+", "+[first];

Nov 13 '05 #1
1 3193
Hi Neill. Several possiblities.

A simple and flexible one is to display the summary in a subreport in the
Report Footer section of your main report. The query for the subreport will
contain the same WHERE clause so that it covers the same records as the main
report, i.e.:
WHERE (((tblCharges.month_yr) Between
[Forms]![frmSetReportRange]![txtStart] And
[Forms]![frmSetReportRange]![txtEnd]))

It may be possible to add Running Sum controls to your report to accumulate
the values that you need for the Report Footer section. That works reliably.

Using code in the events of the report is NOT recommended. In many cases,
the code does not fire for pages that are not previewed/printed, so this
approach gives wrong results.

In cases where you cannot generate a simple query for the subreport, you
could create the SQL statement in code before you OpenReport, and assign it
to the SQL statement of the QueryDef that feeds the subreport. Best reserved
for when you are really stuck. (If you are utterly stuck, there's always a
temp table.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Wayfarer" <ne**********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I've built a report using a aggregate query that is grouped by Month +
Year, Program and Name. When I feed the date ranges as query
parameters, it will very properly print out a report that shows a
separate page for each program by month with the names of the folks in
that program. So far, so good... But what I need to complete the
report is a summary page for the entire date range in the same format.
I have no &%^# idea how to do that.

Do I have to fire off a separate report using the same parameters from
an event in the month-by-month report, or is there an easier way? Can
anyone help me (with this problem...the rest of me is beyond help)?

If anyone's feeling particularly masochistic, the SQL statement is
included below.

TIA

Neill Dumont

==
SELECT tblCharges.month_yr, tblCharges.program, [last]+", "+[first] AS
Name, Sum(IIf([professional],[hours],0)) AS Prof,
Sum(IIf([unduplicated],1,0)) AS [1st Time],
Sum(IIf([gender]="Male",[hours],0)) AS Male,
Sum(IIf([gender]="Female",[hours],0)) AS Female, Sum(IIf(age([dob])
Between 6 And 17,[hours],0)) AS [6-17], Sum(IIf(age([dob]) Between 18
And 29,[hours],0)) AS [18-29], Sum(IIf(age([dob]) Between 30 And
65,[hours],0)) AS [30-65], Sum(IIf(age([dob])>65,[hours],0)) AS [65+],
Sum(IIf([ethnicity]="White",[hours],0)) AS White,
Sum(IIf([ethnicity]="Black",[hours],0)) AS Black,
Sum(IIf([ethnicity]="Hispanic",[hours],0)) AS Hispanic,
Sum(IIf([ethnicity]="Asian",[hours],0)) AS Asian,
Sum(IIf([ethnicity]="Native American",[hours],0)) AS NatAm,
Sum(IIf([ethnicity]="Other",[hours],0)) AS Other,
Sum(IIf([hours]>0,[hours],0)) AS TotHours
FROM tblVolunteers RIGHT JOIN tblCharges ON tblVolunteers.vol_id =
tblCharges.vol_id
WHERE (((tblCharges.month_yr) Between
[Forms]![frmSetReportRange]![txtStart] And
[Forms]![frmSetReportRange]![txtEnd]))
GROUP BY tblCharges.month_yr, tblCharges.program, [last]+", "+[first];

Nov 13 '05 #2

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

Similar topics

3
by: Rob Meade | last post by:
Hi all, I have a login page which has username and password fields, a login button, and 2 validation controls (one for each field) - currently I have controls to display to the summary if the...
2
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post...
3
by: Brian Cryer | last post by:
I posted this question recently to microsoft.public.dotnet.languages.vb but didn't get any answer. I'm hoping that someone here will be able to help me. I'm working on a project using VB.NET...
1
by: pathi | last post by:
I have placed the Compare Validator, and a Range validator for two TextBoxes, and turn the Visible property false. Then I have palced a Validator Summary control on the WebForm. But the Summary did...
2
by: rodchar | last post by:
hey all, i was wondering how you would do this. i have a webform with a summary page on it. The summary page tells you the followng: # of Employees Unchanged # of Employees Underwriting #...
0
by: Andy_Khosravi | last post by:
I have a nuisance problem with my reports. The summary's for some of my sections will from time to time happen to be placed as the first item on a page. This will occur if, for example, the detail...
0
by: tfsmag | last post by:
I know how to do summary footers in a gridview... but when i try it in a paged gridview it puts a footer on every page of just the items on that page. Any suggestions on how to get it to work so...
1
by: =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= | last post by:
I'm having trouble working with a Summary Validation control. I need to click my submit button twice for the Summary to display when validation errors occur on the page. Background: My page...
0
by: =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= | last post by:
I'm having trouble working with a Summary Validation control. I need to click my submit button twice for the Summary to display when validation errors occur on the page. Background: My page...
2
by: starburst | last post by:
Hi, Im trying to create a summary page for a vote on pages in ASP.Net and having trouble writing the SQL to do this. Each page has a "was this helpfull YES or NO" which when an option is chosen...
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
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
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...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.