Criteria not excluding data

J

Jennifer

I have this expression set in a query and it works fine.

CorrectLOA: IIf([EndDate] Is Not Null And [EndReason]="LOA","1","")

But I want to set the criteria to exclude records that come back with 1. I
have tried to put in "Is Null" or "1" or 1 but it is not filtering those
records.

What can I set my criteria or should I change the expression.
 
D

Dale Fye

That is because your IIF() statement is returning a string "1", not a numeric
1. Additionally, if the expression inside the IIF( ) statement is False,
then it returns an empty string "", not NULL.

So, your criteria should be:
Criteria: = ""

Or, you could just exclude this computed column and have a WHERE clause that
looks like:

WHERE [EndDate] IS NULL
OR [EndReason] <> "LOA"
 

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