counting certain records for a total in the page header

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

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
 
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.
 
Don said:
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.
 
Back
Top