And function in Access queries

S

skline

I am having trouble adding a simple "and" statement in
Access 2000? Is the syntax different than Excel? I am
using it in an "if" statement and know that if in Access
is "IIF".
 
D

Douglas J. Steele

Yes, Access is different than Excel in this regard.

Rather than

If(And(Cond1, Cond2), Value_If_True, Value_If_False)

it's

IIf(Cond1 And Cond2, Value_If_True, Value_If_False)
 
Top