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
 General SQL Server Forums
 New to SQL Server Programming
 how to remove ..Dot

Author  Topic 

chbala85
Starting Member

49 Posts

Posted - 2013-10-14 : 01:52:20
hi all,

i have a table like below

patientid code
11 101.3
12 102..3
13 103.
14 104..3.
15 109.3
16 105..3

but need like below to remove . (dot)

patientid code
11 101.3
12 102.3
13 103
14 104.3
15 109.3
16 105.3


please help me.

Thanks,

Krishn.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-14 : 01:59:23
use replace

UPDATE table
SET code = REPLACE(code,'..','.')


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

chbala85
Starting Member

49 Posts

Posted - 2013-10-14 : 02:16:11
Thanks for replay.

i need to remove last . (dot) also 104..3.


thanks,

krish
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-14 : 04:57:53
[code]
UPDATE table
SET code = STUFF(Code,LEN(Code),1,'')
WHERE RIGHT(Code,1) = '.'
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -