Print Page | Close Window

"Contains"

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10973
Printed Date: 28 Apr 2024 at 10:22am


Topic: "Contains"
Posted By: Woodworker
Subject: "Contains"
Date Posted: 26 Aug 2010 at 9:10am
Can anyone assist in the correct syntax to extract specific words from a string.

Field is "COMPANY"  I need to create groups that contain similar company types.

Group CITY OF (name of city)

Group TOWN OF (name of town)

Group STATE of (name of state)

Group VILLAGE of (name of village) or Village of X

The data within the field is not consistent in format.  Somewhere in the string there will be the city, or state or etc.

I am used to being able to extract "CONTAINS" and I can pull that information.

Thank you 



Replies:
Posted By: DBlank
Date Posted: 26 Aug 2010 at 9:21am
you can use LIKE and * as a multi character wild card
e.g.
table.field LIKE '*red*'
 
or the instr() function works similarly but returns a numeric value of the location of where the string starts within another string (instead of boolean as above)


Posted By: Woodworker
Date Posted: 26 Aug 2010 at 9:30am
Outstanding.  I don't know why that was so difficult for me.  Perfection.

Thank you...



Print Page | Close Window