Board index » delphi » Simple parameter query question

Simple parameter query question


2007-02-12 09:48:02 AM
delphi71
Is there a value that one can pass to a parameter in a query that means
"all"?
Example 1:
Customer ID = 24
Doc Type ID = 19
Example 2:
Customer ID = all
Doc Type ID = 19
How can I avoid having to create 2 separate base queries to return these
results?
Thanks
Mitch
 
 

Re:Simple parameter query question

Mitch writes:
Quote
Is there a value that one can pass to a parameter in a query that
means "all"?

Example 1:
Customer ID = 24
Doc Type ID = 19

Example 2:
Customer ID = all
Doc Type ID = 19

How can I avoid having to create 2 separate base queries to return
these results?

Thanks

Mitch
...WHERE ((FLD1 = :PARAM1) OR (:PARAM1 IS NULL)) AND ...
--
Bill Todd (TeamB)
 

Re:Simple parameter query question

See the previous thread, "Where Sometimes". That was what I was trying
to do.
--
Patrick Moloney
 

Re:Simple parameter query question

Mitch writes:
Quote
Is there a value that one can pass to a parameter in a query that
means "all"?
Multiposted, please pick *one* place to post your questions. Post elsewhere
only if you don't get a sufficient response after a reasonable time.
--
Wayne Niddery - Winwright, Inc (www.winwright.ca)
"Bandwagons are like streetcars, there'll be another along in a few
minutes."