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 2005 Forums
 Transact-SQL (2005)
 alter string

Author  Topic 

dbonneau
Yak Posting Veteran

50 Posts

Posted - 2009-03-06 : 11:52:48
Name Date Time
F.FF.YYAE09 2009-03-03 15:00
F.FF.YYAE09 2009-03-03 15:00
F.FF.YYAE09 2009-03-03 15:00
F.FF.YYAE09 2009-03-03 15:00
F.FF.YYAE09 2009-03-03 15:00
F.FF.YYA 2009-03-05 15:59
F.FF.YYA 2009-03-05 15:59
F.FF.YYA 2009-03-05 15:59
F.FF.YYA 2009-03-05 15:59
F.FF.YYA 2009-03-05 16:00
F.FF.YYA 2009-03-05 16:00

Hi I have a table that has two different values in one field. Please refer to name field.
I would like to take out "E09" so I can have only one uniform value as "F.FF.YYA" in name field.
could you please help me to alter this ?

Thanks

raky
Aged Yak Warrior

767 Posts

Posted - 2009-03-06 : 12:15:31
try this

update yourtable
set name = substring(name,1,len(name)-3)
where name like '%E09'
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-03-06 : 12:19:37
Or this..

update urtable set Name = replace(Name,'E09','')
Go to Top of Page

dbonneau
Yak Posting Veteran

50 Posts

Posted - 2009-03-06 : 12:23:41
It works fine! Thank you so much guys !
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2009-03-06 : 23:45:40
Welcome.....
Go to Top of Page
   

- Advertisement -