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

Multiple Wildcards in a parameter selection Ver8.5

Status
Not open for further replies.

ready4data

Programmer
Apr 9, 2001
18
US
Is there a way to allow multiple values (wildcard) in a parameter field. I can get 1 value to work using:
(if {?Wildcard Dealer} <> ""
then {HISTORY.ACCOUNTNAME} like "*" + {?Wildcard Dealer}+ "*"
else if {?Wildcard Dealer} = ""
Then True)
But can't get it to work with multiple values.
Do you have to do something with a loop statement?
Help is appreciated
Thanks,
Scott
 
I tried the formula that was in the thread but all it did was search forever and not return any records. I don't know if it has to do with the rest of the selection formula.
Here is what I have:
numbervar Increment;
stringvar FieldValue;
for Increment:= 1 to count({?Wildcard Dealer}) Step 1 Do
if instr({HISTORY.ACCOUNTNAME},{?Wildcard Dealer} [Increment]) >0 then
FieldValue := {HISTORY.ACCOUNTNAME};
{HISTORY.ACCOUNTNAME} = FieldValue and
//the existing code below works OK
(if {?Activity Code} <> "All"
then{HISTORY.CATEGORY} = {?Activity Code}
else if {?Activity Code} = "All" or {?Activity Code} = '""'
then True) and
{HISTORY.STARTDATE} = {?Date Range} and
(if {?Result Code} <> "All"
then{HISTORY.RESULT} = {?Result Code}
else if {?Result Code} = "All" or {?Result Code} = '""'
then True) and
(if {?Region} <> "All"
then{USERINFO.TITLE} = {?Region}
else if {?Region} = "All" or {?Region} = '""'
then True) and
(if {?Brand} <> "All"
then{DEALER_PROFILE.ASSOCIATION} = {?Brand}
else if {?Brand} = "All" or {?Brand} = '""'
then True) and
(if {?User Name} <> "All"
then{HISTORY.USERNAME} = {?User Name}
else if {?User Name} = "All" or {?User Name} = '""'
then True)

any other ideas?
 
I removed the rest of the selection formulas and tried just the wildcard section but can't get the syntax right.

numbervar Increment;
stringvar FieldValue;
(if {?Wildcard Dealer} <> ""
then
for Increment:= 1 to count({?Wildcard Dealer}) Step 1 Do
if instr({HISTORY.ACCOUNTNAME},{HISTORY.ACCOUNTNAME} like "*" + {?Wildcard Dealer} + "*" [Increment]) >0 then
FieldValue := {HISTORY.ACCOUNTNAME};
{HISTORY.ACCOUNTNAME} = FieldValue
else if {?Wildcard Dealer} = ""
Then True)

Can someone help?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top