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 2000 Forums
 Transact-SQL (2000)
 charindex or pat index?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-12 : 09:57:03
Yum Cha writes "How do I get everything to the right of a hyphen in a string?
for example if SDFDE-89 and i only want the 89.....please help!!
thanks"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-12 : 10:03:25

declare @yum varchar(10)
set @yum = 'SDFDE-89'
select right(@yum, len(@yum) - charindex('-',@yum))

 


<O>
Go to Top of Page
   

- Advertisement -