Solved

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

Posted on 2012-03-31
4
772 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 500 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 100

Expert Comment

by:mlmcc
ID: 37791725
Good solution.

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

mlmcc
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.

685 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