iif and statement

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

Guest

Hi - am trying to write and iif statement with an "And" statment similar to
Excel formula ie If(and(a=1,b=2),"Good","Bad"). If this easy in an Access
query. The "And" part obviously does not work. I have tired to use to iif
statments to achieve and it does work for some but is producing inconsistent
results. I have a few nested iif arguments to write

thanks in advance
 
Kevin:

Think in terms of IF-THEN-ELSE. That is how IIF statements work. For your
example:

iif((a=1 and b=2),"Good","Bad")
**If a=1 and b=2 then display "Good", otherwise display "Bad".

And the statements can be nested.

iif((a=1 and b=2), "Good", iif((c=3 and d=4),"Right", "Wrong"))

HTH

Sharkbyte
 
excellent - too easy
--
Kevin


Sharkbyte said:
Kevin:

Think in terms of IF-THEN-ELSE. That is how IIF statements work. For your
example:

iif((a=1 and b=2),"Good","Bad")
**If a=1 and b=2 then display "Good", otherwise display "Bad".

And the statements can be nested.

iif((a=1 and b=2), "Good", iif((c=3 and d=4),"Right", "Wrong"))

HTH

Sharkbyte
 
Back
Top