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 2012 Forums
 Transact-SQL (2012)
 remove text from a certain work to end

Author  Topic 

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2014-08-15 : 13:39:28
hi
i want to remove text from a certain word in a column to end if column. i will never now how many char it will be from start of the word t the end of the column.

is this possibe and whats the best way to do it

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-08-15 : 13:55:35
Could you show us an example? It could be as easy as using REPLACE, but we need to see some examples.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2014-08-15 : 14:03:11
hi
this is data from the column from table
USD Fixed 2.7375% 30/360 VS 3M US LIBOR ACT/360 12Nov23

so want it to find ACT remove ACT to the end
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-08-15 : 14:27:22
select left(yourcolumn, charindex('ACT', yourcolumn)-1), yourcolumn
from yourtable
where...

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -