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

Search for Punctuation in a Field

Status
Not open for further replies.

kime1974

Programmer
Oct 30, 2006
36
0
0
US
I am using Crystal XI. We have a report we use to determine if a field has punctuation in it. This is an audit report used to catch these errors prior to an extract being taken. We are currently looking for results to be returned in the select expert using the following:

like ["*!*", "*#*", "*$*", "*%*", "*(*", "*)*", "*-*", "*,*", "*.*", "*:*", "*`*", "*~*", "*+*", "*=*", "@"]

I was just wondering if there was something more efficient to do to look for any kind of punctuation in the field.

Thanks!
Kim
 

It might be easier to verify that every character is a valid alpha or numeric value - use this formula:

whileprintingrecords;
numbervar x := 0;
numbervar y;

for y := 1 to len({yourfield}) do
(if ascw({yourfield}[y]) in [65 to 90,97 to 122,48 to 57] then x
else x := x + 1);

x

Then by sorting or group selection you can identify any bad records as those where the formula <> 0.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top