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

Remove dashes

Status
Not open for further replies.

Zonie32

Technical User
Jan 13, 2004
242
US
Hi all,

Using MS Access 2003, win xp...

I have a table with a column for Social Security Number roughly 2500 records. Some users put dashes in the SSN number, others have not.

I want to remove all dashes and keep the number uniform like this 123456789, not like 123-45-6789. How do I accomplish this?

Thanks!
 
Replace should suit.

Replace([SSN],"-","")

Aside: I think there are some fairly strict rules about storing SSNs and keeping them secure.

 
Use an update query and the replace function. Replace dashes with zero lenght strings...

Code:
Replace(SSN, "-","",1)

 
If you are stlll accepting user input for the table, once you have it cleaned up you may also want to put in place some client side and/or server side validation that lets in only good data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top