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

Adding dashes to a Social Security data field 1

Status
Not open for further replies.

Laurelin

Programmer
Jan 24, 2002
29
US
I'm trying to add dashes into a Social Security Number data field and I cannot figure our exactly how to write the formula. If anybody has any suggestions then I would appreciate hearing them.
 
if the field that contains the SS number is a string field use:
left({SS#.field},3 +"-"+mid({SS#.field},4,2)+"-"+right({SS#.field},4)

if the field that contains the SS number is a number field use:

stringvar SSnum:= totext({SS#.field},0,"");
left(SSnum,3 +"-"+mid(SSnum,4,2)+"-"+right(SSnum,4)
Mike

 
The picture() function is made for exactly these types of situations.

Picture({SSfield},"999-99-9999") returns a perfectly formatted SS number.

Pciture({Phone#},"(999) 999-9999") returns a perfectly formatted phone number.

I use it all the time. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top