PARAMETER QUERY FOR IS NULL OR IS NOT NULL

S

Sammie

How can I write a parameter that asks the user to specify if a field is null
or is not null?

field: commission (currency)
the criteria is null works just fine in the query design, but not in the
parameter.

Thanks
Sammie
 
J

John Spencer

Perhaps

(SomeField is Null and [Enter Parameter] = "Is Null")
Or (SomeField is not null and [Enter Parameter] = "Is Not Null")

If you enter Is Null for the parameter you match the first condition and
if you enter Is Not Null for the parameter you match the second condition.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
S

Sammie

I liked this simpler approach, but it didn't work. the is null parameter
didn't return any records, and the is not null returned records that didn't
match the other criteria of my query. I guess working with null values can
be tricky. If there's an obvious answer to this, please let me know.
Otherwise, I'll forget about this idea.
Thanks.
Sammie

John Spencer said:
Perhaps

(SomeField is Null and [Enter Parameter] = "Is Null")
Or (SomeField is not null and [Enter Parameter] = "Is Not Null")

If you enter Is Null for the parameter you match the first condition and
if you enter Is Not Null for the parameter you match the second condition.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

How can I write a parameter that asks the user to specify if a field is null
or is not null?

field: commission (currency)
the criteria is null works just fine in the query design, but not in the
parameter.

Thanks
Sammie
 
S

Sammie

Sorry, Jamie, but I'm not familiar with SQL. I don't think I want to pursue
this. Thanks anyway.
Sammie
 

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