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

Still need parameter discreet and range help!

Status
Not open for further replies.

muffntuf

MIS
Jan 7, 2003
155
US
k said -

Make the parameter a range type, and set the default value to " " (a space).

In the Report->Record Selection->Record place something like:

if isnull({?part})
or
trim(maximum({?Part})) = ""
then
{Customer.part} like "*"& minimum({?Part}) & "*"
else
if {?Part} = "2" then
{Customer.part} >= minimum({?Part})
and
{Customer.part} <= maximum({?Part})

So if they only enter one value (the lower range), it will search for one, if they enter the full range, it will search for >= the first value entered and <= the second value.

This will also pass the SQL to the database so performance should be fine.

My response-

If they need all of the records to come back do I still need to add an 'all' statement somewhere in the mix?


{?Part Number} = "All" or {@Part Number} ={?Part Number}


This is what I put in, if I choose the "" I get all records back, if I choose a range with just a couple numbers off the front end of the part number I get zilch.
Here's what I did:
(if isnull({?Part Number})
or
trim(maximum({?Part Number})) = ""
then
{@Part Number} like "*"& minimum({?Part Number}) & "*"
else
if {?Part Number} = "2" then
{@Part Number} >= minimum({?Part Number})
and
{@Part Number} <= maximum({?Part Number}))


Oh and the part number is formulated like this because of the paritial bit,

trim({@CommonPartNum}) [1 to 6]
 
Try:

(
if {?Part Number} <> "All" then
(
if isnull({?Part Number})
or
trim(maximum({?Part Number})) = ""
then
{@Part Number} like "*"& minimum({?Part Number}) & "*"
else
if {?Part Number} = "2" then
{@Part Number} >= minimum({?Part Number})
and
{@Part Number} <= maximum({?Part Number})
)
else
if {?Part Number} = "All" then
true
)

Now they can enter All or you can have it as an additional default value as well.

-k
 
I still am not getting anything back. They want to be able to just take a partial part number like

151421 is the part number they just want to enter 15 and get all the records back that start with 15.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top