Print Page | Close Window

Using Like operator with parameter

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9685
Printed Date: 26 May 2024 at 11:06pm


Topic: Using Like operator with parameter
Posted By: victoria61485
Subject: Using Like operator with parameter
Date Posted: 14 Apr 2010 at 5:32am
Is there a way to use the Like Operator with a Parameter field? I have a Parameter, {?CRA}, which has a list of default values. The field that I want to use {?CRA} with is IDB. It has entries such as 1FDG or 25BK163g. There are thousands of variations but the default values in the parameter, in this case would be, FDG and BK. A user will need to find all of the records in IDB with FDG and BK somewhere in the field using a drop down box. I cannot possibly import all of the thousands of variations into the default value list in {?CRA} so I was wondering if there was a way to select IDB = *{?CRA}* or IDB Is Like {?CRA}?



Replies:
Posted By: DBlank
Date Posted: 14 Apr 2010 at 5:53am
yes.
Make your param as the two options of FDG and BK
in your select expert
 
instr({table.field},{?CRA})>0


Posted By: victoria61485
Date Posted: 14 Apr 2010 at 6:00am
If I get an error message that says"This array must be subscripted, do I put {?CRA} in brackets, [{?CRA}]?


Posted By: DBlank
Date Posted: 14 Apr 2010 at 6:05am
You are letting them select more than one option in the parameter?


Posted By: victoria61485
Date Posted: 14 Apr 2010 at 7:05am
I took that out and now it has an error that says "Does not support."


Posted By: DBlank
Date Posted: 14 Apr 2010 at 7:14am

the param says does not support or the select statement gives that error?



Posted By: victoria61485
Date Posted: 14 Apr 2010 at 7:32am
I re-ran it several times and it seems to work now, Thank you!



Print Page | Close Window