Using a Wildcard with a Parameter

Posted on 2009-05-20
Last Modified: 2012-05-07
I am writing a report that will generate a list of survey recipients.  I have two parameters setup: one for the bank acronym and one for job title.  My problem is that, if the user enters only "Teller" in the parameter, it will only return Tellers.  However, there are job titles like Teller Supervisor and FSR/Teller that should also be returned.  I have tried using {Imaging.job_code} like "*{?Job Title}*" but no results are returned with this.  What other way can I use a wildcard with this parameter to get what I'm needing?

{@Status} = "A" and
not isnull ({Imaging.NovellID}) and
{@JobTitle} and
(if {?Bank Acronym} = "*" then true
    else {@Bank} = {?Bank Acronym}) and
{Imaging.job_code} like {?Job Title}

Open in new window

Question by:tpomeroy
  • 4
  • 3
LVL 100

Accepted Solution

mlmcc earned 125 total points
ID: 24433523

{Imaging.job_code} like "*" & {?Job Title} & "*"


Author Comment

ID: 24433565
When I used this, I received this error message:  "This array must be subscripted.  For example: Array [i]."

Author Comment

ID: 24433686
Okay, I changed the "allow multiple values" in the parameter to False and the error went away.  However, the users really need the ability to enter multiple job titles.  Anyway around that?
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

LVL 100

Expert Comment

ID: 24434107
Not easily that I can think of.

Can you populate the parameter with valid values so they can choose all the ones they want?


Author Comment

ID: 24434541
I could but there are hundreds of them.  I will try that, though.
LVL 100

Expert Comment

ID: 24435011
You can use the ability to add them from the table rather than having to add them.

If the user enters *Teller* as a value along with another value does it work if you use

{ReportField} LIKE {?Param}


Author Comment

ID: 24435121
No it does not.

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Reports 9 and Subreports 3 65
Crystal Reports last day of month 2 53
Crystal 11 Suppress main report section if subreport is blank 24 129
Crystal Reports 13 5 59
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question