The third parameter of CHARINDEX is the starting position for the search. Nest a CHARINDEX within a CHARINDEX to start searching after the first (or second) space.
Position of the second space:
CHARINDEX(' ', SearchString, CHARINDEX(' ',SearchString) + 1) --Start after 1st space
Position of the third space:
CHARINDEX(' ', SearchString,
CHARINDEX(' ', SearchString,
CHARINDEX(' ',SearchString) + 1)
--Angel
-----------------------------------
Every time I lose my mind, I wonder
if it's really worth finding.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.