Using "Iif" in field row of calculated query

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

Guest

I am creating a new field that doesn't exsist in a table. To do this, I must
define how it is calculated. I need to do it so that "IF a value in another
field NOT equal to "value" then...." I know how to say "IF a value in another
field is this, do this", how do I say NOT equal to this value???
 
Mandorallin said:
I am creating a new field that doesn't exsist in a table. To do this, I must
define how it is calculated. I need to do it so that "IF a value in another
field NOT equal to "value" then...." I know how to say "IF a value in another
field is this, do this", how do I say NOT equal to this value???


Use the IIf function when the check something in an
expression. (IF is a VBA statement and won't make sense in
an SQL statement.)

The not equal operator is <>

IIf(A <> B, value if not equal, value if equal)

but you can turn it around and use equals

IIf(A = B, value if equal, value if not equal)
 
Mandorallin said:
I am creating a new field that doesn't exsist in a table. To do this, I must
define how it is calculated. I need to do it so that "IF a value in another
field NOT equal to "value" then...." I know how to say "IF a value in another
field is this, do this", how do I say NOT equal to this value???

Please see my answer on the previous thread.


Sincerely,

Chris O.
 
Back
Top