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

Using split comma delimited string in record selection

Status
Not open for further replies.

crystaldev1

Programmer
Nov 6, 2003
232
US
Hello, I'm using CR 11 and sql server 2008.

This should be a simple fix which I keep having issues. I have a string parameter such as "Mike,Brown,John,...". I need to split this up and include only the records where {a.name}= "Mike" or "Brown" or "John" or "etc". Number of names can vary from parameter. Thanks.

 
(
ubound(split({?parm},",")) >= 3 and
{a.name}= split({?parm},",")[3]
)

-LB
 
As mentioned, I could have 1 name, 4 names, or none. Will this formula still work?
 
For what? What is your intention? Do you want to include all parameter names in the selection formula? You didn't really indicate that originally.

-LB
 
In retrospect, you should be able to simply use:

{a.name} in {?Parm}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top