Parameter Query

  • Thread starter Thread starter Alec Green
  • Start date Start date
A

Alec Green

I have a simple parameter query that returns the sales orders for a
particular sales area when promted, how can I get the query to return all
orders for all areas if the return key is pressed at the parameter prompt??

Thanks

Alec
 
Alec said:
I have a simple parameter query that returns the sales orders for a
particular sales area when promted, how can I get the query to return all
orders for all areas if the return key is pressed at the parameter prompt??

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Like this:

....
WHERE (sales_area = [parameter] And [parameter] IS NOT NULL
OR [parameter] IS NULL)

What's happening:

(sales_area = [parameter] And [parameter] IS NOT NULL

will pull the sales area when the user enters a valid sales area.

OR [parameter] IS NULL)

will pull all records when the parameter is empty.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQzl6soechKqOuFEgEQIC5ACfSyJa5N+whRzxRe8muQ/GdOOjeH8An287
BX0BDH/Y+FmsspFT/JI7V9Cn
=XsSw
-----END PGP SIGNATURE-----
 
I have a simple parameter query that returns the sales orders for a
particular sales area when promted, how can I get the query to return all
orders for all areas if the return key is pressed at the parameter prompt??

Thanks

Alec

Use a criterion of

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


John W. Vinson[MVP]
 
WHERE (sales_area = [parameter] And [parameter] IS NOT NULL
OR [parameter] IS NULL)

Actually, MG, the expression [sales_area] = [parameter] will only be
TRUE if [parameter] is in fact not null. The IS NOT NULL test isn't
needed.

John W. Vinson[MVP]
 
Back
Top