IIf statement with IS Null

  • Thread starter Thread starter AJ Sless
  • Start date Start date
A

AJ Sless

I am trying to use IS Null in an Iif statement and it is
not working.

I want to be able to exclude certain part #s based on a
condition, so I am trying to make an If statement in
Access that will say,

If aff="test", then only show my NULLs, otherwise show me
everything. I can put Is Null in the conditions record
and it works fine. It doesn't seem to work when I combine
with an If statement.

Can anyone help me out?
 
I am trying to use IS Null in an Iif statement and it is
not working.

You need to use the IsNull() *function* instead.
I want to be able to exclude certain part #s based on a
condition, so I am trying to make an If statement in
Access that will say,

If aff="test", then only show my NULLs, otherwise show me
everything. I can put Is Null in the conditions record
and it works fine. It doesn't seem to work when I combine
with an If statement.

Is this a criterion on a Query? If so you don't need IIF at all: use a
criterion on aff of

WHERE [aff] = "Test" AND <fieldname> IS NULL OR [aff] <> "Test"

You don't say what you mean by "show my nulls" - i.e. what field or
fields are NULL, so this may not be exactly what you want!
 

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

Iif with And conditions 3
IIf statement 2
IIf statement help 3
Multiple IIf's 6
IIF Statement In Query Doesn't Work Right 3
IIF statement in a Query ? 5
IIF Statements nested 5
Iif Statement based on 2 conditions 2

Back
Top