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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top