Count 2

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to count the Text A-1 and B-2E I know how to count just the one
as seen here =Abs(Sum([FTE Cat]="A-1")) I have tried =Abs(Sum([FTE Cat]="A-1"
or "B2E")) and it does not work. It gives me a total of 7. The 7 is all the
records.

Thanks Keith
 
I think that what you trying to do is that

=Sum(Abs([FTE Cat]="A-1"))

You need to swop between the abs and the sum
 
Hi, Keith.

Is it B-2E or B2E? You've listed both. I'll go with B-2E in the example
below.

Try:

=Abs(Sum([FTE Cat]="A-1")) + Abs(Sum([FTE Cat]="B-2E"))

In this case, Abs(Sum(BooleanValue)) = Sum(Abs(BooleanValue), so swapping
these two functions in the expression will result in the same value.
Therefore, they're interchangeable.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
I would like to count the Text A-1 and B-2E I know how to count just the one
as seen here =Abs(Sum([FTE Cat]="A-1")) I have tried =Abs(Sum([FTE Cat]="A-1"
or "B2E")) and it does not work. It gives me a total of 7. The 7 is all the
records.

Thanks Keith

The Access operators AND and OR look like the English language
conjunctions - but they're not. They are Boolean operators, just as +
and - are arithmatic operators.

X AND Y

will return the value TRUE if X evaluates to a TRUE expression, and Y
also evaluates to True. Otherwise it returns FALSE.

X OR Y

will return the value TRUE if either X is true, or Y is true, or both
are true; it will return FALSE if both X and Y are FALSE.

So the expression

[FTE Cat]="A-1" OR "B2E"

will always be TRUE; the expression "B2E" is not equal to zero, so
Access treats it as TRUE.

Use

[FTE Cat] = "A-1" OR [FTE Cat] = "B2E"

instead.

John W. Vinson[MVP]
 
Back
Top