iif statement w/null value

G

Guest

I'm tryin to run an if statement that looks like this:

IIf([ColorGroup]=Null,"NA",[ColorGroup])

The NA is not returning, the blank fields are still blank. What am I doing
wrong?
 
G

Guest

This usually works better:

IIf(IsNull([Colourgroup]),"NA",[Colourgroup])

HTH

Rico
 
G

Guest

THANKS!!!

rico said:
This usually works better:

IIf(IsNull([Colourgroup]),"NA",[Colourgroup])

HTH

Rico

GOL said:
I'm tryin to run an if statement that looks like this:

IIf([ColorGroup]=Null,"NA",[ColorGroup])

The NA is not returning, the blank fields are still blank. What am I doing
wrong?
 
J

John Vinson

I'm tryin to run an if statement that looks like this:

IIf([ColorGroup]=Null,"NA",[ColorGroup])

The NA is not returning, the blank fields are still blank. What am I doing
wrong?

Nothing is equal to NULL, or for that matter *unequal* to NULL. Use
the NZ() function instead:

NZ([ColorGroup], "NA")

John W. Vinson[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

Top