countif in Access Reports

P

P T Pi

I need to countif, where [gradeCompleted] is text with values of 8,9,10,11 or
12
=IIf([qClass Profile R2]![gradeCompleted]=8,1,0)
This is an inherited db that has 2 full capacity tables and will not accept
a datatype change
 
A

Allen Browne

Try:
=IIf([qClass Profile R2]![gradeCompleted] IN ("8", "9", "10", "11",
"12"), 1, 0)

I am uncertain whether the IN operator will work in this context, but give
it a shot. If that doesn't work, you could try putting the expression into a
Field in the query, and you would then be able to sum that field in your
report.
 
P

P T Pi

Thank you very much Allen. It actually worked well.

Allen Browne said:
Try:
=IIf([qClass Profile R2]![gradeCompleted] IN ("8", "9", "10", "11",
"12"), 1, 0)

I am uncertain whether the IN operator will work in this context, but give
it a shot. If that doesn't work, you could try putting the expression into a
Field in the query, and you would then be able to sum that field in your
report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

P T Pi said:
I need to countif, where [gradeCompleted] is text with values of 8,9,10,11
or
12
=IIf([qClass Profile R2]![gradeCompleted]=8,1,0)
This is an inherited db that has 2 full capacity tables and will not
accept
a datatype change
 

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

Top