IIF Function

D

Denver

Hello,

I have a checkbox in this Field "Red Line" and i have this calculations in
my query that counts number of True

Red Line: Abs(Sum(IIf([Rd Line]=0,1,0))-([Total Records]))

i want to count number of False, how can i modify this formula? iam using
access 2003.

thanks for any help
 
D

Douglas J. Steele

Sum(IIf([Rd Line]=0, 1, 0) actually gives you the number of False. From
that, you're subtracting the total number of records and then taking the
absolute value to get True.

I think you'll find that using Sum(IIf([Rd Line] = 0, 0, 1) will give you
the number of True.
 
D

Douglas J. Steele

Ooops. I see I left off the closing parentheses.

Sum(IIf([Rd Line]=0, 1, 0)) should give you the count of False, Sum(IIf([Rd
Line]=0, 0, 1)) should give you the count of True.

Sorry about that.


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas J. Steele said:
Sum(IIf([Rd Line]=0, 1, 0) actually gives you the number of False. From
that, you're subtracting the total number of records and then taking the
absolute value to get True.

I think you'll find that using Sum(IIf([Rd Line] = 0, 0, 1) will give you
the number of True.


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Denver said:
Hello,

I have a checkbox in this Field "Red Line" and i have this calculations
in
my query that counts number of True

Red Line: Abs(Sum(IIf([Rd Line]=0,1,0))-([Total Records]))

i want to count number of False, how can i modify this formula? iam using
access 2003.

thanks for any help
 
D

Denver

Thank you very much Douglas J.Steele.


Douglas J. Steele said:
Ooops. I see I left off the closing parentheses.

Sum(IIf([Rd Line]=0, 1, 0)) should give you the count of False, Sum(IIf([Rd
Line]=0, 0, 1)) should give you the count of True.

Sorry about that.


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas J. Steele said:
Sum(IIf([Rd Line]=0, 1, 0) actually gives you the number of False. From
that, you're subtracting the total number of records and then taking the
absolute value to get True.

I think you'll find that using Sum(IIf([Rd Line] = 0, 0, 1) will give you
the number of True.


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Denver said:
Hello,

I have a checkbox in this Field "Red Line" and i have this calculations
in
my query that counts number of True

Red Line: Abs(Sum(IIf([Rd Line]=0,1,0))-([Total Records]))

i want to count number of False, how can i modify this formula? iam using
access 2003.

thanks for any help
 

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