Using AND in an IIF statement

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.
 
J

Jason Lepack

Assuming that by empty you mean null.

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

Cheers,
Jason Lepack
 
G

Guest

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.
 

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

Top