Lan Cui
Lan Cui

Reputation: 137

How to use multi-value parameters in selection formula

I am working in a crystal report and want to create a parameter that lets users enter multiple strings to search for.

For example, when I enter the search terms "hammer", "wax", and "mask" I need get all the records that include any of these three words.

I am trying to use wildcards, like this:

(if {?DescWildcard} <> 'x' then lowercase({POIT.Description}) like '*' & lowercase({?DescWildcard}) & '*' else 1=1)

But, it only works with one keyword.

How can I deal with multiple values?

Upvotes: 1

Views: 6682

Answers (1)

Ryan
Ryan

Reputation: 7287

See the thread here: Looping through a multiple value parameter array

Working with a multi-value parameter is made a little harder when you want to do text searching because the addition of wildcards can be a little tricky.

The accepted answer in that thread will automatically surround your keywords with wildcards so you'd be free to do something like:

{?DescWildcard} = 'x' or lowercase({POIT.Description}) like delimit({?DescWildcard})

Upvotes: 4

Related Questions