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

Parameter to return all, specific record, or null 1

Status
Not open for further replies.

AcctSolver

Technical User
Sep 27, 2003
28
US
I have a report where I would like the user to be able to select all records based upon the field {Parts.PartNo}. This field will not always have data in it, and it is string data.

I'd like them to be able to free text for a particular part#, such as J123, select multiple part numbers, select all part numbers ([Parts.PartNo} <> " "), or just those records without part numbers ({Parts.PartNo} = " ").
How do I set the parameter up properly to do that?
 
Create a parameter and set as allow multiple entries and allow editing of default entries

In Default add

All
No Part Number


In select

(If {Param} = 'All' then true else
If {Param} = 'No Part Number' then isnull(partnumberfield} else partnumberfield = {Param})

Wrapping in brackets allows you to have other conditions

Ian

 
(
(
{?Parm} = "No Part Number" and
(
isnull({table.partno}) or
trim({table.partno}) = ""
)
) or
(
{?Parm} <> "All" and
{table.partno} = {?Parm}
) or
{?Parm} = "All"
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top