IIF in a report Footer

G

GMan

=Count(IIf([Gender]="M",0)) in a report footer will total all the Males in
the query the report is based on.

=Count(IIf([Gender]="F",0)) will likewise give me all the females.

But can I add an additional criteria to the IIF statenent. If my query
tracks M and F - -- - and also HS or College,

Can I add aadd additional criteria to the IIF. I want 4 entries in my footer:

Male College
Male High School
Female College
Female High School

I am having problems gettinga single IIf to recognize more than one
criteria. If =Count(IIf([Gender]="M",0)) is Male, how would I get Male
High School??

Thanks
 
F

fredg

=Count(IIf([Gender]="M",0)) in a report footer will total all the Males in
the query the report is based on.

=Count(IIf([Gender]="F",0)) will likewise give me all the females.

But can I add an additional criteria to the IIF statenent. If my query
tracks M and F - -- - and also HS or College,

Can I add aadd additional criteria to the IIF. I want 4 entries in my footer:

Male College
Male High School
Female College
Female High School

I am having problems gettinga single IIf to recognize more than one
criteria. If =Count(IIf([Gender]="M",0)) is Male, how would I get Male
High School??

Thanks

Is [HS] a Yes/No field or a text field?

Is [College] a Yes/No field or a text field?

Assuming both are Yes/No fields (-1 = Yes) ....

Male:
=Sum(IIf([Gender]= "M",1,0))
Female:
=Sum(IIf(Gender] = "F",1,0))
Male College:
=Sum(IIf([Gender]="M" and [College] = -1,1,0))
Female College:
=Sum(IIf([Gender]="F" and [College] = -1,1,0))
Male HighSchool:
=Sum(IIf([Gender]="M" and [HS] = -1,1,0))
Female HighSchool:
=Sum(IIf([Gender]="F" and [HS] = -1,1,0))

If Text field's, then
=Sum(IIf([Gender]="F" and [HS] = "Y",1,0))
=Sum(IIf([Gender]="M" and [HS] = "Y",1,0))
=Sum(IIf([Gender] = "M" and [College] = "Y",1,0))
=Sum(IIf([Gender] = "F" and [College] = "Y",1,0))
 
G

GMan

Thanks. but about 5 minutes after I posted, I looked at it again. I was
formatting the condition wrong, in a way that was ignoring the second
condition but not erroring.

Appreciate the response, however.

fredg said:
=Count(IIf([Gender]="M",0)) in a report footer will total all the Males in
the query the report is based on.

=Count(IIf([Gender]="F",0)) will likewise give me all the females.

But can I add an additional criteria to the IIF statenent. If my query
tracks M and F - -- - and also HS or College,

Can I add aadd additional criteria to the IIF. I want 4 entries in my footer:

Male College
Male High School
Female College
Female High School

I am having problems gettinga single IIf to recognize more than one
criteria. If =Count(IIf([Gender]="M",0)) is Male, how would I get Male
High School??

Thanks

Is [HS] a Yes/No field or a text field?

Is [College] a Yes/No field or a text field?

Assuming both are Yes/No fields (-1 = Yes) ....

Male:
=Sum(IIf([Gender]= "M",1,0))
Female:
=Sum(IIf(Gender] = "F",1,0))
Male College:
=Sum(IIf([Gender]="M" and [College] = -1,1,0))
Female College:
=Sum(IIf([Gender]="F" and [College] = -1,1,0))
Male HighSchool:
=Sum(IIf([Gender]="M" and [HS] = -1,1,0))
Female HighSchool:
=Sum(IIf([Gender]="F" and [HS] = -1,1,0))

If Text field's, then
=Sum(IIf([Gender]="F" and [HS] = "Y",1,0))
=Sum(IIf([Gender]="M" and [HS] = "Y",1,0))
=Sum(IIf([Gender] = "M" and [College] = "Y",1,0))
=Sum(IIf([Gender] = "F" and [College] = "Y",1,0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top