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

Using Wildcards In Multiple Value Parameter 1

Status
Not open for further replies.

ctwilliams

Programmer
Feb 15, 2002
86
US
I have a parameter {?Field} that is set to allow multiple values.

I have a formula {@strField} that joins the parameter values (array) into a comma-delimited string with # characters surrounding each value (eg. #value1#,#value2#)

@strField:
[blue]"#" & join({?Field},"#,#") & "#"[/blue]

My record selection formula contains the following:

[blue]instr({@strField}, "#" & {DBField} & "#") > 0[/blue]

Now the user would like to be able to type * wildcards into the parameter values. How can I change my record selection formula to accomodate this, since I'm using "instr" instead of "LIKE"?
 
Hi,
If the parameter allows multiple values you do not need to process it before using it in an = or like formula -
For LIKE the parameter input by the user would include the * ( In my test, I used Department Numbers, so the user would input T791* and T792* and T790* for a parameter named DeptNo and the selection formula would be
{table.deptnbr} like {?DeptNo}.

This returns all departments whose Nbr ( actually a string) starts with those chars..

[profile]

 
Hi,
Glad to help; The ability to use multiple values directly,
instead of using the older IN ['value','Value2','Value3']
structure saves a lot of post-submission processing of parameter values.

[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top