IIF Function

  • Thread starter Thread starter Denver
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top