iif and statement

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
 
G

Guest

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
 
G

Guest

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
 

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

Too many IIF statements 3
Query Criteria IIf statement 4
iif statement 2
IIF(AND) statement 3
Iif Statement help 6
Complicated IIf Statement Problem 24
iif statement 5
IIF is Too Complex 4

Top