Solved

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

Posted on 2012-03-31
4
734 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
for loop with Set 4 46
array6 challenfge 6 63
Eclipse Neon start with Admin account only 6 50
Not needed 13 57
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now