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)
 SQL

Author  Topic 

sqldba20
Posting Yak Master

183 Posts

Posted - 2010-11-23 : 17:27:50
Folks:

I have 2 columns in a table ID and NameDetails with the data in this format.

ID NameDetails
1 TXY 12%
2 BN 13%
3 HJH 14
4 XCHN 18%
5 BH 23
6 HJK 25
7 UHZ 34%


The NameDetails is a varchar type. I want the NameDetails columns to not display the % sign (remove % sign)....The output should be:

ID NameDetails
1 TXY 12
2 BN 13
3 HJH 14
4 XCHN 18
5 BH 23
6 HJK 25
7 UHZ 34


What will be my query be?


Thanks !

X002548
Not Just a Number

15586 Posts

Posted - 2010-11-23 : 17:33:33
If only you looked up in BOL or Google

SELECT REPLACE(NameDetails,'%','')

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -