Convert ss# text to number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I convert ss# text to a number or vice versa?? My ss# text has dashes.
Thanks
RayJr
 
How can I convert ss# text to a number or vice versa?? My ss# text has dashes.
Thanks
RayJr
Ray,

What do you mean by vice versa? Your SS# already has the dashes!

Do you wish to change a text string 123-45-6789 to 123456789 as a
Number datatype or retain it as a Text datatype?

To convert it to a Number Datatype (Long Integer),
first add a Number datatype field to your table, then:

Update YourTable Set YourTable.[NumberDatatypeFieldName] =
CLng(Left([SS#],3) & Mid([SS#],5,2) & Right([SS#],4));

To maintain it as a Text datatype in the [SS#] field:
Update YourTable Set YourTable.[SS#] = Left([SS#],3) & Mid([SS#],5,2)
& Right([SS#],4);
 
Back
Top