I am currently working on a way to change telephone numbers
i am only working off of 1 table, so there should be no link issues
and trying to setup a script that will search the 'room' table
and the field 'telephone'
it is currently set out like this with out the dashes
dashes are only there for formatting purpose in the post
i was thinking maybe there is a way i can use the substring function
to look at the last 4 didgets, if it is between a certain set of numbers
say the last set is 1000-1999 i want the 456 change to a new number say 555
is there a way i can do it with substring
or do i need to look at a different way of doing it?
'1234561001' into #t1 union all select
'1234561502' union all select
'1234561999' union all select
'1234562001' union all select
'1234562501' union all select
update #t1 set c1=substring(c1,1,3)+'555'+substring(c1,7,4)
where substring(c1,7,4) between '1001' and '1999'
update #t1 set c1=substring(c1,1,3)+'999'+substring(c1,7,4)
where substring(c1,7,4) in ('1502','2501')
select * from #t1