basic calculation question

J

JOUIOUI

I'm trying to add the number of times "C" and "M" appear in the ClassCode
field on a report, this calculation is not working, it is only counting the
"C". Please tell me what I'm doing wrong...I've searched this site and am
not finding the answers that I need.

=Sum(Abs([ClassCode]="C" And "M"))
 
J

John Spencer

=Abs(Sum(ClassCode = "C" OR ClassCode = "M"))

You can't short cut the boolean comparison. YOu may have meant to count
if BOTH C and M are present somewhere in the field. To do that you
could try

=Abs(Sum(ClassCode Like "*c*" and ClassCode Like "*m*"))

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

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