Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null values in Parameter query 1

Status
Not open for further replies.

mdlaugh1

Technical User
Jan 17, 2006
76
US
I have a field that might contain null values... I have a parameter query over this field as follows:

[Enter the Type of Work or * for All] & "*".

This is leaving out the null records. How can I pull All including Nulls if * is entered?

I've tried
[Enter the Type of Work or * for All] & "*" & " "

but do not pull any records in this case.

thanks!
 
I guess your posted code is in a criteria cell of the Query grid:
Like [Enter the Type of Work or * for All] & '*' OR [Enter the Type of Work or * for All]='*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV...

Yes, that pulled the null records... (and yes it's in the Criteria cell of the Query grid...

I neglected to include the full phrase... I left off the UCase... when I add it back on the query runs excessively long, then pulls no records.

Here's the final statement:

Like UCase([Enter the Type of Work or * for All] & '*' Or [Enter the Type of Work or * for All]='*')
 
Why using UCase as Access is not case sensitive ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
oh, sorry... forgot another piece to puzzle.. I'm linking to an Oracle back end..
 
In Access, I have added a zero-length-string to the column/field but this might take forever to run:
Code:
WHERE [WorkType] & "" Like UCase([Enter the Type of Work or * for All] & '*'

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I wonder your final statement ...
I'd prefer this:
Like UCase([Enter the Type of Work or * for All]) & '*' Or [Enter the Type of Work or * for All]='*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
you are close to amazing.... :)

that did it.. thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top