Search a string in the database field

Hello ,
        I have a crystal report that has a database field "Payee" name. I would like to use a parameter to search any string in the Payee name field and bring all the checks that has this string or Employee Name(Ex.Sandra) on it.
For Example, I have the Employee name "Sandra" in Payee name field...I should be able to get all the records that has this employee name in it....when i type this string "Sandra" in the parameter field.

Also, i have this same field "Payee" name in a subreport of this main report. I would like to bring up all the checks in there as well that has this string "Sandra" on them. Any ideas?...

What is the best approach to achieve this without affecting the performance of this report?

Thanks very much!
jen robAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

YOu can build a filter on it

Create the parameter as a string

In the select expert use
{Namefield} LIKE "*" & {?NameParam} & "*"

Open in new window

You might also try
{Namefield} LIKE "%" & {?NameParam} & "%"

Open in new window

It sounds like you can just use a parameter in the record selection formula (eg. Report > Selection Formula > Record), as mlmcc suggested.  If your field will only contain the name you're looking for, you can just use {Payee name field} = {?parameter}.  If the name is just part of the field, you can use wildcards, as mlmcc suggested.

 As for the subreport, you could set it up the same way, with a parameter that's compared to the field in the record selection formula.  But then right-click on the subreport, select "Change subreport links" and link the parameter in the main report to the parameter in the subreport.  Add the main report parameter to the list on the right, then select the subreport parameter from the dropdown list on the bottom left to link the two parameters.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.