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!

Search for the pipe character

Status
Not open for further replies.

gk17

Technical User
Sep 6, 2013
86
0
0
US
I'm using CR XI.

I have a field that contains many pipe characters in it. I want to look for a specific pattern in that field but can't figure out how to search for this properly. This is most likely due to it being a special character (bit operator?).

For example, I want to search for |A| (pipe A pipe). I want to use it in a formula and this is what I have so far:

Code:
if {Message} LIKE '%[|]A[|]%' then 'ABC'
else 'XYZ'

Was searching this online for a while and tried using brackets as suggested by one of the sites. I also tried using a backslash in front of the pipe (\|) to see if it will be treated differently but no success there either.

Thanks.
 
Do you mean "|A|" instead? I tried what you suggested and also tried changing it to |A| but both didn't yield ABC. I checked and the field does have |A| in it.

Thanks.
 
Just in case it matters, this field is nvarchar type.
 
Charliy's suggestion works for me when I tested. Can you double-check?
[tt]if "|A|" in {Message} then 'ABC'
else 'XYZ'[/tt]
 
Checked again and found what I did wrong. I was using a sub-report also and was trying to use this as a group header. I tried this within the sub-report and got it working.

Is there any way I can still use this as a group header in the main report if this field is filtered out within the sub-report? I want to have ABC, XZY and other groups in the main report.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top