Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Reports XI: Search for and count occurrence(s) of a specific character in a string field?

Posted on 2012-03-31
4
Medium Priority
?
872 Views
Last Modified: 2012-03-31
Is there a way that I can search a string field for a specific character and then count the amount of occurrences for that character? Basically, I need a true/false test as to  whether or not a string contains two ampersands.

I've played around with some different string functions but I can't quite seem to dial it in.


Thank you
0
Comment
Question by:QTony
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
OCDan earned 2000 total points
ID: 37791449
If {table.field} like '*&*&*'
then 1
else 0

That should do the trick
0
 

Author Closing Comment

by:QTony
ID: 37791496
I don't why I didn't see the obvious---Thanks
0
 
LVL 9

Expert Comment

by:OCDan
ID: 37791498
We have all been there mate
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37791725
Good solution.

Another would be UBound(Split({YourField},'&')) >= 3

mlmcc
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Simple Linear Regression
Introduction to Processes

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question