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

Ignoring Null Parameter Values

Status
Not open for further replies.

jpalmer150

Technical User
Jul 1, 2003
46
US
Seems like a simple issue but I haven't been unable to find a solution anywhere.

I'd like to allow my users to choose which parameters to filter by. If a value is not given for a specific parameter I'd like to report to include all values for that field.

For example, using three fields:

Customer Number
Customer Name
Customer Address

How can I get the correct records if a user provides a Customer Name and Address but no Account number?

Thanks in advance,

JP


{Rebate_err.SAP End Cust #} = {?Ship-to SAP Number} [1] AND
{?Ship-to Customer Name} [1] IN {Rebate_err.SAP End Cust Name} AND
{?Address} [1] IN {Rebate_err.SAP End customer address}
 
Generally I create defaults for parameters, such as 0 for number parms, then the record selection formula would be:

(
if {?Ship-to SAP Number}[1] <> 0 then
{Rebate_err.SAP End Cust #} in {?Ship-to SAP Number}
else
if {?Ship-to SAP Number}[1] = 0 then
true
)

If it's a string, try:

(
if {?Ship-to SAP Number}[1] <> &quot;ALL&quot; then
{Rebate_err.SAP End Cust #} in {?Ship-to SAP Number}
else
if {?Ship-to SAP Number}[1] = &quot;ALL&quot; then
true
)

Note that you're subscripting the parameter, which means that you're allowing for multiple choices, just make the default choice &quot;ALL&quot; or 0 accordingly, and things should be fine.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top