PC Review


Reply
Thread Tools Rate Thread

counting certain records for a total in the page header

 
 
Don
Guest
Posts: n/a
 
      28th Jul 2003
I am trying to count only certain records in a field such
as 2-A, 2-B and 2-C but not count 1-A, 1-B, 3-A ect. My
goal is to count these record values by report sort i.e.
each set of records are seperated/sorted in the report by
factory. The result I am looking for is a number like 6 if
there are 6 total of 2-A, 2-B, or 2-C (Field name "Rate")
in any combination. I need this report to give a seperate
count for each department in the report.

Thanks Don
 
Reply With Quote
 
 
 
 
Don
Guest
Posts: n/a
 
      28th Jul 2003
Resubmitted to try to make more clear.

I am trying to count only certain records in a
field "Grade" such as 2-A, 2-B and 2-C but not count 1-A,
1-B, 3-A ect. My goal is to count these record values
by "report sort" i.e. each set of records are
seperated/sorted in the report by Department. The result I
am looking for is a number like 6 if there is a 6 total of
2-A, 2-B, or 2-C in Field name "Grade" in any combination
in that Department. I need this report to give a seperate
count for each department in the report.
>
>Thanks Don
>.
>

 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      28th Jul 2003
Don wrote:

>Resubmitted to try to make more clear.
>
>I am trying to count only certain records in a
>field "Grade" such as 2-A, 2-B and 2-C but not count 1-A,
>1-B, 3-A ect. My goal is to count these record values
>by "report sort" i.e. each set of records are
>seperated/sorted in the report by Department. The result I
>am looking for is a number like 6 if there is a 6 total of
>2-A, 2-B, or 2-C in Field name "Grade" in any combination
>in that Department. I need this report to give a seperate
>count for each department in the report.


There are several ways to approach this kind of thing,
depending on where you want the totals to be displayed or
how many separate values you want to count.

If you want the total of each grade to be displayed
immediately after the grade's records, then you should use
the Sorting and Grouping feature (View menu) to specify the
group along with a group footer. You will probably want to
group on the field Grade or an expression, e.g.
=Left(Grade, 1)
Then you can add a text box to the group footer to display
the number of records in that grade. The text box's
expression would simply be:
=Count(*)

If you want to display a few totals at the end of the
report, then you may be able to get away with using text
boxes in the report footer section with expressions
something like:
=Count(IIf(Grade = "2-A", 1, Null))
or maybe:
=Count(IIf(Left(Grade, 1)= "2", 1, Null))

On the other hand, if you want to display the totals for all
groups at the end of the report, then it would be better to
use a subreport based on a totals query. Once you get the
query producing the right results, it should be trivial to
create the subreport.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header Problem (page header & report header) Eva Microsoft Access 2 23rd Oct 2009 03:46 PM
If a certain cell has a certain value, a certain worksheet is hidden or visible Matt Microsoft Excel Programming 3 9th Feb 2007 07:49 AM
Page total & continued total on each page =?Utf-8?B?SXJzaGFkIEFsYW0=?= Microsoft Access Reports 1 17th Sep 2006 07:57 PM
Page total in Header of report. Uses las page total. How to fix? Gerard Mears Microsoft Access Reports 4 4th Oct 2004 10:18 AM
Report showing current total, previous total and average total? Richard Black Microsoft Access Reports 3 20th Jul 2004 01:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:49 PM.