iif is not null query

G

Guest

Hi, I have a query which has 5 fields and one expression filed which will
test, starting from the last field backward to see it there is a date in it
and if so it will display a message like “transaction completed†if not will
look at the next field and so on.

Since I am working backward from field 5 to 1 as 5 being the last one in
sequence how can I test the "is not null" condition?

I try several ways but nothing seems to work. The statement is something
like this:

Status: IIF([Field5]= "is not null", "transaction complete", IIF([Field4]=
"is not null", "Transaction in progress", IIF([Field3])="is not null",
"transaction pending" ...etc.

What's the correct way to write this statement?

Thank you,
Silvio
 
D

Douglas J. Steele

It's not

[Field5]= "is not null"

it's

[Field5] is not null.

However, in IIf statements, you might want to use

Not IsNull([Field5])
 
G

Guest

Thank you. I was able to use '[field5]= true' and it seems to work fine.

Douglas J. Steele said:
It's not

[Field5]= "is not null"

it's

[Field5] is not null.

However, in IIf statements, you might want to use

Not IsNull([Field5])

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Silvio said:
Hi, I have a query which has 5 fields and one expression filed which will
test, starting from the last field backward to see it there is a date in
it
and if so it will display a message like "transaction completed" if not
will
look at the next field and so on.

Since I am working backward from field 5 to 1 as 5 being the last one in
sequence how can I test the "is not null" condition?

I try several ways but nothing seems to work. The statement is something
like this:

Status: IIF([Field5]= "is not null", "transaction complete", IIF([Field4]=
"is not null", "Transaction in progress", IIF([Field3])="is not null",
"transaction pending" ...etc.

What's the correct way to write this statement?

Thank you,
Silvio
 

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