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
 Delete or hide the end of a sentence

Author  Topic 

frank6666
Starting Member

2 Posts

Posted - 2010-12-20 : 09:22:10
Hi

That's my first post here...

I am trying to remove the end of a sentence in a SQL result but I don't know how to do it.

My result look like this: "Smith, John (Test1 - Test2)"
I want the result to be: "Smith, John".
The bits to remove will always be "(Test2 - Test2)", that part won't change from one user to another.

What kind of SQL functions can I use to remove the end of the sentence?

Thanks

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2010-12-20 : 09:31:51
SELECT REPLACE(yourField,' (Test1 - Test2)','')


Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

frank6666
Starting Member

2 Posts

Posted - 2010-12-20 : 10:03:16
Thanks jimf

That is exaclty what I was looking for!
Go to Top of Page
   

- Advertisement -