Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Seperating parts of a string

Status
Not open for further replies.

Brian1219

MIS
Joined
Sep 19, 2001
Messages
5
Location
US
I am currently trying to seperate values in a column that are in the following format

abcd-wxyz

There can be any number of letters before AND after the dash. The only information I need to obtain is everything to the RIGHT of the dash. I know in Oracle there is an "intstr" function. However, I am having problems finding a similar function in SQL server 7.

Any Help would be greatly appreciated.

Thanks in advance
 

Use CHARINDEX or PATINDEX.

Select right(colname,len(colname)-charindex('-',colname)) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top