Using AND in an IIF statement

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

Guest

I'm trying to say:

IIF MEPR field is empty AND TEC field is empty, use RIGHT 4 digits of DESC
field, otherwise use TEC field.

I've used Excel code (IIF(and(isblank(mepr, etc and it doesn't work. I am
not an Access person, but I seem to remember that ACCESS treats AND and OR
differently than Excel. Please help. thanks.
 
Assuming that by empty you mean null.

iif([MEPR] is null AND [TEC] is null, right([DESC],4), [TEC])

Cheers,
Jason Lepack
 
Works! Now I remember. . . thanks!

Ofer Cohen said:
Try

IIF ([MEPR] Is Null And [TEC] Is Null , RIGHT([Desc],4) ,[TEC])


--
Good Luck
BS"D


Jan Buckley said:
I'm trying to say:

IIF MEPR field is empty AND TEC field is empty, use RIGHT 4 digits of DESC
field, otherwise use TEC field.

I've used Excel code (IIF(and(isblank(mepr, etc and it doesn't work. I am
not an Access person, but I seem to remember that ACCESS treats AND and OR
differently than Excel. Please help. thanks.
 
Back
Top