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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Queries w/ null parameters

Status
Not open for further replies.

davidn

MIS
Jul 27, 2000
16
US
I have a query which returns rows containing a column value matching a parameter. Query works now. I want to return all rows if the parameter is null. Anyone have an idea how to do this? I know it can be done, I just don't know how.
 
The simple way to do this is to use an if statement.
if parm = "" then
run this sql
else
run the other one
endif
 
To really run the same one (reduces maintenance):

Code:
If (param = "") Then
[tab]parm = "*"
End If

MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top