IIf statement - checking for text

  • Thread starter Thread starter LizaKM
  • Start date Start date
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!
 
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
 
Back
Top