isaacr25
asked on
Query for stripping first 5 characters
I need to run a query on a database table (let's call it TABLE1) to KEEP the LAST 4 characters for all values in the SSN field. How do I do this? Thanks.
Database: SQL Server 2000
Database: SQL Server 2000
ASKER
This is a select query. Will this actually remove the preceding characters, leaving 4 characters?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
a typo from chapmandew's post
update t1
set ssnfield = right(ssnfield, 4)
from table1 t1
or
update table1
set ssnfield = right(ssnfield, 4)
update t1
set ssnfield = right(ssnfield, 4)
from table1 t1
or
update table1
set ssnfield = right(ssnfield, 4)
yep, good catch...forgot my alias.
from table1