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

Parameters in record selection formula

Status
Not open for further replies.

Wallegator

Programmer
Jan 3, 2001
58
0
0
US
I have parameter fields for two fields: a vendor number and a job number. I want the end user to have the ability to specify none, one, or both of the parameters. My record selection formula is below and it doesn't work. End result is no records if I select none, one, or all of the parameters. What am I doing wrong? I thought it might be the "AND" in lieu of "OR" but "OR" doesn't work either. Thank you in advance.

(If {?VendorNumber}<>&quot;&quot; Then {APM_MASTER__DISTRIBUTION.Vendor}=({?VendorNumber}) Else True)
And
(If {?Job}<>&quot;&quot; Then {APM_MASTER__DISTRIBUTION.Job}=({?Job}) Else True)
 
I have a FAQ on record selections that might prove useful:

faq767-3825

Try creating a default value (click Set Default Values in the edit parameter screen) of &quot;All&quot; for each parameter and then try this:

(
If {?VendorNumber}<>&quot;All&quot; Then {APM_MASTER__DISTRIBUTION.Vendor}=({?VendorNumber})
Else If {?VendorNumber} = &quot;All&quot; Then
True
)
And
(
If {?Job}<>&quot;All&quot; Then
{APM_MASTER__DISTRIBUTION.Job}={?Job}
Else if {?Job}=&quot;All&quot; then
True
)

If the select All (or use the default) then they will get all rows for that portion of the criteria, otherwise it will use what was entered.

You can see what is geting passed to the database using Database->Show SQL Query

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top