A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count of Report values in Report Footer



 
 
Thread Tools Display Modes
  #1  
Old November 21st, 2005, 06:59 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Count of Report values in Report Footer

Hi
I need to create a count at the end of my report that tells me how many
occurances of a certain value appear in the report.
e.g. Report field of "Issue". Possible values of "Red" or "Amber". Need to
count how many times red and amber occurs.
I guess, something like "COUNT(Issue) where Issue = "Red")" is needed.
e.g. 2 (more complex)
e.g. Report field of "Name". I do not want to "hard code" the possible
values that can appear in the report for Name but I need to count how many
times each name appears in the report.
I have played around with SUM and COUNT and tried the Running Sum function
but to no avail.
Any help much appreciated.
Thanks, Mark
  #2  
Old November 21st, 2005, 07:25 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Count of Report values in Report Footer

Mark A wrote:
I need to create a count at the end of my report that tells me how many
occurances of a certain value appear in the report.
e.g. Report field of "Issue". Possible values of "Red" or "Amber". Need to
count how many times red and amber occurs.
I guess, something like "COUNT(Issue) where Issue = "Red")" is needed.
e.g. 2 (more complex)
e.g. Report field of "Name". I do not want to "hard code" the possible
values that can appear in the report for Name but I need to count how many
times each name appears in the report.
I have played around with SUM and COUNT and tried the Running Sum function
but to no avail.



For a quick and dirty approach, you can use expressions like
this:
=Sum(IIf(Issue = "red", 1, 0))

But, you're right, you do not want to use hard coded values
most of the time. A more general approach is to create a
Totals type query that retrieves the desired data and
calculates the counts for each name or issue. Then use the
query as the record source for a subreport.

--
Marsh
MVP [MS Access]
  #3  
Old November 24th, 2005, 04:11 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Count of Report values in Report Footer

Hi Marshall,

Ive tried the =Sum(IIf(Issue = "red", 1, 0)) but it did not seem to work,
could you provide an alternate approach or give more details regarding how to
create a totals type query. Any help you can provide would be great.

Regards.
Nick

"Marshall Barton" wrote:

Mark A wrote:
I need to create a count at the end of my report that tells me how many
occurances of a certain value appear in the report.
e.g. Report field of "Issue". Possible values of "Red" or "Amber". Need to
count how many times red and amber occurs.
I guess, something like "COUNT(Issue) where Issue = "Red")" is needed.
e.g. 2 (more complex)
e.g. Report field of "Name". I do not want to "hard code" the possible
values that can appear in the report for Name but I need to count how many
times each name appears in the report.
I have played around with SUM and COUNT and tried the Running Sum function
but to no avail.



For a quick and dirty approach, you can use expressions like
this:
=Sum(IIf(Issue = "red", 1, 0))

But, you're right, you do not want to use hard coded values
most of the time. A more general approach is to create a
Totals type query that retrieves the desired data and
calculates the counts for each name or issue. Then use the
query as the record source for a subreport.

--
Marsh
MVP [MS Access]

  #4  
Old November 24th, 2005, 07:06 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Count of Report values in Report Footer

The =Sum(IIf(Issue = "red", 1, 0)) expression is a tried
and true text box expression as long as [Issue] is a field
in the report's record source table/query. It also assumes
that the [Issue] field actually has a value of "red" and not
some foreign key number into another table that contains the
color name. Also, make sure the text box is in the report
(or group) footer, not the page footer.

The subreport approach would be a trivial report baxed on a
Totals query along these lines:

SELECT Issue, Count(*) As CodeCount
FROM thetable
WHERE samecriteriaas mainreport
GROUP BY Issue
--
Marsh
MVP [MS Access]


Nick Gregory Nick wrote:
Ive tried the =Sum(IIf(Issue = "red", 1, 0)) but it did not seem to work,
could you provide an alternate approach or give more details regarding how to
create a totals type query. Any help you can provide would be great.


Mark A wrote:
I need to create a count at the end of my report that tells me how many
occurances of a certain value appear in the report.
e.g. Report field of "Issue". Possible values of "Red" or "Amber". Need to
count how many times red and amber occurs.
I guess, something like "COUNT(Issue) where Issue = "Red")" is needed.
e.g. 2 (more complex)
e.g. Report field of "Name". I do not want to "hard code" the possible
values that can appear in the report for Name but I need to count how many
times each name appears in the report.
I have played around with SUM and COUNT and tried the Running Sum function
but to no avail.



"Marshall Barton" wrote:
For a quick and dirty approach, you can use expressions like
this:
=Sum(IIf(Issue = "red", 1, 0))

But, you're right, you do not want to use hard coded values
most of the time. A more general approach is to create a
Totals type query that retrieves the desired data and
calculates the counts for each name or issue. Then use the
query as the record source for a subreport.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to keep the report footer on the same page? homer Setting Up & Running Reports 3 October 21st, 2005 07:27 PM
Report footer is printing on a separate page Dana W. Ciardi General Discussion 0 September 12th, 2005 04:48 PM
To Sharkbyte and all: Calculate a total values in group level Ally General Discussion 6 June 13th, 2005 08:16 PM
Need count in footer but no detail in report mscertified Setting Up & Running Reports 1 February 28th, 2005 10:54 PM
Repost-Still Suffering with Subreports IreneJ Setting Up & Running Reports 9 August 31st, 2004 04:55 AM


All times are GMT +1. The time now is 09:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.