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.
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]
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
151421 is the part number they just want to enter 15 and get all the records back that start with 15.
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]
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