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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Puncuation

Status
Not open for further replies.

QueTech

MIS
Apr 13, 2003
79
US
Hi,

I am using Crystal 8.5 on Windows Xp PC. I need a formula that will check for puncuations in client names.

Thank you
 
Hi there,

You will need to create a formula like the following

if instr({Field}," ") > 0 then
replace({Field}," ","") else
if instr({Field},"!") > 0 then
replace({Field},"!","") else
if instr({Field},"-") > 0 then
replace({Field},"-","") else
{field}

You will need to repeate each of the instr and replace statements for each of the punctuations you want to check for and remove.

HTH

Steve

 
You would have to nest the replaces, as in:

replace(replace(replace({table.name},"'",""),"-","")" ","")//etc.

There is a better solution developed by SynapseVampire I think, although I couldn't locate it, that checks for non-letters. Something like:

numbervar i;
numbervar j := len({table.name});
stringvar name;

for i := 1 to j do(
if {table.name} in [chr(65) to chr(90),chr(97) to chr(122)] or
{table.name} = " " then
name := name + {table.name};
name;

-LB
 
Once you've found the punctuation, what do you intend to do?

Try providing technical information:

Crystal version
Database/connectivity
Example data
Expected output

You can iterate through the field and take action based on any character within a formula.

-k
 
I am using Crystal 8.5 pulling data from a Cashe database. I need to report on all Cleint Names that have a puncuation in them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top