IIF statement in query

R

RaulDR

Hi All,

This criteria should return all record if the parameter is null or the user
just press enter. But it's not working please help.

IIf([Enter Area Code:] Is Null,"Is not Null",[Enter Area Code:])

TIA
 
R

RaulDR

Hi Gina,

it worked! thanks! :)

Gina Whipp said:
RaulDR,

Try...

Like [Enter Area Code OR Press Enter for All] & "*"

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

RaulDR said:
Hi All,

This criteria should return all record if the parameter is null or the
user
just press enter. But it's not working please help.

IIf([Enter Area Code:] Is Null,"Is not Null",[Enter Area Code:])

TIA
 
J

John W. Vinson

Hi All,

This criteria should return all record if the parameter is null or the user
just press enter. But it's not working please help.

IIf([Enter Area Code:] Is Null,"Is not Null",[Enter Area Code:])

TIA

That will search for the literal text string "Is not Null" - and I doubt any
area codes match that.

Gina's suggestion will work; a bit better (since it doesn't depend on
wildcards) is

[Enter area code:] OR [Enter area code:] IS NULL
 
R

RaulDR

Thanks John!

John W. Vinson said:
Hi All,

This criteria should return all record if the parameter is null or the user
just press enter. But it's not working please help.

IIf([Enter Area Code:] Is Null,"Is not Null",[Enter Area Code:])

TIA

That will search for the literal text string "Is not Null" - and I doubt any
area codes match that.

Gina's suggestion will work; a bit better (since it doesn't depend on
wildcards) is

[Enter area code:] OR [Enter area code:] IS NULL
 
G

Gina Whipp

You're welcome!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

RaulDR said:
Hi Gina,

it worked! thanks! :)

Gina Whipp said:
RaulDR,

Try...

Like [Enter Area Code OR Press Enter for All] & "*"

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

RaulDR said:
Hi All,

This criteria should return all record if the parameter is null or the
user
just press enter. But it's not working please help.

IIf([Enter Area Code:] Is Null,"Is not Null",[Enter Area Code:])

TIA
 
G

Gina Whipp

John,

I USED to use that until I discovered typos!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

John W. Vinson said:
Hi All,

This criteria should return all record if the parameter is null or the
user
just press enter. But it's not working please help.

IIf([Enter Area Code:] Is Null,"Is not Null",[Enter Area Code:])

TIA

That will search for the literal text string "Is not Null" - and I doubt
any
area codes match that.

Gina's suggestion will work; a bit better (since it doesn't depend on
wildcards) is

[Enter area code:] OR [Enter area code:] IS NULL
 

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