Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Removing Dashes(-) from SSN field in Query

Author  Topic 

rkumar28
Starting Member

49 Posts

Posted - 2006-01-09 : 15:19:25
Hi,

I have a SSN field which is a char(12) field. The way the SSN is stored not consistent (Something like below):

36-435-0001
364-35-0001
36435-0001
36-3450001

I trying to write an Sql that can grab only the numeric portion of the SSN and ignore the dashes (-).

I want the output as:

364350001
364350001
364350001
363450001

Will appreciate any advice on this…..

Thanks



Raj

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-01-09 : 15:21:18
SELECT REPLACE(SSN, '-', '')
FROM YourTable

Tara Kizer
aka tduggan
Go to Top of Page
   

- Advertisement -