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

Locating a particular word in String field

Status
Not open for further replies.

rico7937

IS-IT--Management
Feb 20, 2001
33
US
I am using Crystal Reports V10. I am working with problem mgt. tickets and there is a field called problem abstract which is a string field (60). I am trying to write a statement that will allow me to search this string field and pull any tickets with the word "Visalia" in the field.
This is what I am using and it's not pulling all of the tickets due to different variations.(Ex. NCCF/VISALIA, REKV-VISALAI, RUSH:VISALIA...)

Here is my coding statement:

{PROBLEMS.OPEN_DATE} in YearToDate
and
{PROBLEMS.PROBLEM_ABSTRACT} like ["Visali*"]

Any help would be greatly appreciated !
 
Use the instr() function:

instr({PROBLEMS.PROBLEM_ABSTRACT},"Visalia")>0

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Rico:

I beleive that you can also use:
Code:
"Visalia" [blue]IN[/blue] {PROBLEMS.PROBLEM_ABSTRACT}
Depending on CASING of your field you may also want to use:
Code:
"VISALIA" [blue]IN UpperCase[/blue]({PROBLEMS.PROBLEM_ABSTRACT})

Hope This Helps,

Mike
______________________________________________________________
[banghead] "It Seems All My Problems Exist Between Keyboard and Chair"
 
I would use a SQL expression to convert the field to upper case, as in {%probabst}:

ucase(problems.`problemabstract`)

Then use that in your record selection formula, limiting the text to that which you think is consistently present, like:

{PROBLEMS.OPEN_DATE} in YearToDate
and
{%probabst} like "*VISAL*"

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top