How to add a count in query for reports

  • Thread starter Thread starter Msloujon
  • Start date Start date
M

Msloujon

I have this table where I will need two counts on the report. Both columns
are "PASS or FAIL" One I've named PassFail and the other is FinalPassFail now
What I want on my report is 'INITIAL PASS, INITITAL FAIL' and most of the
time thru the first testing they will "pass" and sometime we may have one or
two to "fail". I would like to know how many thru the first testing "pass" or
"fail". Then this boards go out get painted and return for testing a second
time to "pass" or "fail" so I need a count for 'FINAL PASS, FINAL FAIL'. How
can I write this in the query so that it will show in the report. This is
what I current have written =(Sum([CountPassFail])) in the report - CONTROL
SOURCE and now I have to ENTER PARAMETER VALUE when doing the report. Can
someone help this simple mind person? Thanks
 
First, what type of field is PassFail and FinalPassFail. If they are
yes/no fields then you can use the expressions

=Abs(Sum(PassFail)) for the number of passes
=Abs(Sum(FinalPassFail)) for the number of final passes

=Count(PassFail) - Abs(Sum(PassFail)) for the number of fails

The number of final Pass fails can be a bit more complicated since I
assume if the InitialPassFail is a pass you don't want to count the
fails for final fail.

=Count(PassFail)-Abs(Sum(PassFail))-Abs(Sum(FinalPassFail))

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
First, what type of field is PassFail and FinalPassFail. If they are
yes/no fields then you can use the expressions

=Abs(Sum(PassFail)) for the number of passes
=Abs(Sum(FinalPassFail)) for the number of final passes

=Count(PassFail) - Abs(Sum(PassFail)) for the number of fails

The number of final Pass fails can be a bit more complicated since I
assume if the InitialPassFail is a pass you don't want to count the
fails for final fail.

=Count(PassFail)-Abs(Sum(PassFail))-Abs(Sum(FinalPassFail))

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Back
Top