Answered by:
tsql equivalent to substring from the right/instring?

Is there a tsql equivalent to starting a substring from the right? And an instring equivalent? I see that there is a "right" function, to start from the right (I'm on the correct path here, yes?), but I don't know the "instring" equivalent to tell it how many characters to go.
Thank you 
Donna
Question
Answers

Have a look at CHARINDEX, this is basically the TSQL versino of InString.
You might also be interested in PATINDEX.

GertJan
 Proposed as answer by Sorna Kumar MuthurajMVP Tuesday, May 11, 2010 5:22 AM
 Marked as answer by KJian_ Friday, May 14, 2010 9:10 AM
All replies


Not really, though you can use REVERSE function.
You may find the following string functions helpful, though
http://bradsruminations.blogspot.com/2010/01/handystringfunctions.html
Premature optimization is the root of all evil in programming. (c) by Donald Knuth
Naomi Nosonovsky, Sr. ProgrammerAnalyst
My blog Marked as answer by KJian_ Friday, May 14, 2010 9:10 AM
 Unmarked as answer by CoderDonna Friday, August 05, 2011 9:05 PM

Have a look at CHARINDEX, this is basically the TSQL versino of InString.
You might also be interested in PATINDEX.

GertJan
 Proposed as answer by Sorna Kumar MuthurajMVP Tuesday, May 11, 2010 5:22 AM
 Marked as answer by KJian_ Friday, May 14, 2010 9:10 AM