Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: "Contains" Post Reply Post New Topic
Author Message
Woodworker
Newbie
Newbie
Avatar

Joined: 26 Aug 2010
Location: United States
Online Status: Offline
Posts: 2
Quote Woodworker Replybullet Topic: "Contains"
    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 


Edited by Woodworker - 26 Aug 2010 at 9:11am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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)


Edited by DBlank - 26 Aug 2010 at 9:22am
IP IP Logged
Woodworker
Newbie
Newbie
Avatar

Joined: 26 Aug 2010
Location: United States
Online Status: Offline
Posts: 2
Quote Woodworker Replybullet Posted: 26 Aug 2010 at 9:30am
Outstanding.  I don't know why that was so difficult for me.  Perfection.

Thank you...
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.