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

Using Like operator in crystal 2008 2

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
US
I have a field as follows
The field name is schoolfield

Example data
Occupational Therapy - RPI
Engineering[Technology] - RPI

I attempted to do a booleon statement as follows
if {schoolfield1}like "-RPI" then true
else if {schoolfield2}like "-RPI" then true
else false

When I tested this, the Engineering[Technology] returned a true value. The Occupational Therapy - RPI returned a false. It should have returned a true also. Where did I go wrong? Did I do the Like statement incorrectly?
 
Hi Sap

You need to put "*" or "?" in the front of "-RPI". The "*" and "?" are wildcards. "*" for any number of characters and "?" is for one.

L
 
What are you using this boolean for? If you want a selection formula to pick up records with '-RPI', then use a formula like this:

replace({table.schoolfield}," ","") like "*-RPI"

The spaces matter, so I removed them from the field.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top