Access report problem

  • Thread starter Thread starter eubanj
  • Start date Start date
E

eubanj

Report Problem: need to count one field based on another field. (e.g, if the
Region field = Oxnard, then count the "y's" in the QUES 1 field). Can any
one help with this. I am using 2003. Thank you.
 
Report Problem: need to count one field based on another field. (e.g, if the
Region field = Oxnard, then count the "y's" in the QUES 1 field). Can any
one help with this. I am using 2003. Thank you.

It's not clear as to whether the [QUES 1] field is a Text field or a
Yes/No check box field.

using an Unbound text control:
If it is a text "Y"...
=Sum(IIf([Region] = "Oxnard" and [Ques 1] = "Y",1,0))

If it is a Number (i.e a Check Box)...
=Sum(IIf([Region] = "Oxnard",ABS([Ques 1] )))
 
eubanj said:
Report Problem: need to count one field based on another field. (e.g, if the
Region field = Oxnard, then count the "y's" in the QUES 1 field). Can any
one help with this. I am using 2003. Thank you.

In your Query, calculate the QUES 1 field as

QUES 1: IIF [Region] = "Oxnard", 1, 0 and include the QUES 1 field in a Text
Box on your report (it can be Visible = No, if you wish, but if you don't
include it, Access is smart enough to remove it from the Row Source.

Then in the footer SUM([QUES 1]).

There are other ways, but this is simple, straightforward, and easy.
Speaking of which, it's simple, straightforward, and easy if you use Field
Names without a space, and thus don't have to enclose them in square
brackets.

Larry Linson
Micosoft Office Access MVP
 
Back
Top