IIf statement - checking for text

L

LizaKM

Hi,

I'm trying to use an IIf statement to essentially say:

If the following field contains text, then make this field 1, otherwise
make this field 0

The expression I'm using is:

IIf([field containing text]="",0,1)

Any thoughts on why this does not always work?

Thanks!
 
J

Jeff Boyce

Why it does not always work...?

Can you give us any hints about when it does work? When it doesn't?

By the way, "" (a zero-length string) is not the same thing as Null (no
value defined). Do you need to look for either/both?

One way to do that would be:
IIF(Nz([YourField],"")="",0,1)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Text Field Access 2003 2
Problem with IIF statement 5
Access Building a IIF expression in Access 0
IIF statement 2
IIF Statement 2
IIf statement 2
Sum fields w/IIF? 1
IIF Statement 2

Top