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

Need Help Wild Card In String 1

Status
Not open for further replies.

goduke

IS-IT--Management
Feb 13, 2006
65
US
Guys,

I have a report that is looking for a specific string pattern and I am trying to filter to pull in only records that meet that pattern. The problem is, the data is stored using the asterisk, which is also the wildcard character for Crystal Reports.

For example. They are storing VIP customer's name like the following: Mears, Clint **VIP**

I have used about five different like statments, and the one I have now is pulling in all the **VIP** records, but it is also pulling in anyone who has VIP together in their name (Thirumoorthy, DeviPriya). Can you please help me on how I can only get records with **VIP** using the like statment, or any other way? Thanks.

I am using Crystal 11.5
 
A simple solution would be to replace the *:

replace({table.name},"*","") = "VIP"

-LB
 
LB - thanks for the quick response.

However, since the data is stored like: Mears, Clint **VIP** then your forumula returns: Mears, Clint VIP.

So I wont be able to do it that way.

 
a slight modification to LB's formula might give you what you are looking for:


replace({table.name},"**VIP**","") = "~VIP"
//or use some other identifying character instead of '~' that will not be occurring normally


I haven't tried this, but i think you could also use ASCII values to find the '*' -using 'chr(42)'


 
You can use:

replace({table.name},"*","^") like "*^VIP^*"

-LB
 
I got it to work. Thanks everyone!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top