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

How do you remove the hyphen in social sec nbrs? 3

Status
Not open for further replies.

NewToThis2

Technical User
Mar 30, 2004
62
US
C V9 - could someone please tell me the formula to use to remove the hyphen in a social security number? For example, I want 254-98-8889 to read 254988889. Thanks!
 
The formula below will remove all none numeric values (including hyphens):

stringVar strSocialNumber := "254-98-8889";
numberVar i;
stringVar strOutput;

for i:= 1 to len(strSocialNumber) do
(

if isnumeric(strSocialNumber) then
strOutput := strOutput & strSocialNumber
else
strOutput;

);

strOutput;
 
Or to simplify a bit:

Replace({Table.Field},"-","")

-dave
 
Thanks so much everyone! The simplified formula worked best and quickest for me. I was in the middle of a report that needed to go out this morning and I couldn't remember how to remove the dashes. Thanks again for everyone's quick response!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top