INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Jobs from Indeed

Is there a contains function in Cry

Is there a contains function in Cry

(OP)
Is there a contains function in Crystal.  I want to search on a string field that contains a certain phrase.

ex.
record1 - abc glen street, 23456
record2 - xyz glen street, 23457
record3 - glen 12457 st., 23456

i want the search to contain 'glen' so it will pull all three records.

thanks,

RE: Is there a contains function in Cry

For your select expert use:
"glen" in {address.field}

Mike

RE: Is there a contains function in Cry

InStr("string") will return the character number, as an integer of where "string" is first encountered.  If it is not encountered it will return a zero.

InStrRev() works much the same way only it starts at the right of the string instead of the left.

Hope this helps.

Software Support for Macola, Crystal Reports and Goldmine

RE: Is there a contains function in Cry

(OP)
thanks for the responses:

a KISS approach is to use like in the select expert.  

{bill_address.address} like "*glen*" for the above example.

thanks,

RE: Is there a contains function in Cry

I've had problems with the like function when the field I was checking had variable length strings.

Mike

RE: Is there a contains function in Cry

Try them all and see which works best.  Usually when a Variable length string is a problem, it means that CR is reading it as a Memo field and can't process it in any formula.  If that is the case then none of these approaches will work.   See FAQ149-276.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
http://www.kenhamady.com/
tek@kenhamady.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close