Solved

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

Posted on 2012-03-31
4
778 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

A short article about a problem I had getting the GPS LocationListener working.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

751 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