How to find value in text
Posted on 2013-06-03
I am not sure which function to use to find the text I am looking for. I thought it was the CHARINDEX but it is not returning the desired results. I am looking for the name which starts in the same location every time but can be different lengths. The end of the name is designated by a space. I am using the following logic:
SUBSTRING(MASTER24_HISTORY.MRHISTORY,21,CHARINDEX(' ', LEFT(MASTER24_HISTORY.mrHISTORY,22)))
However it is pulling more than just the name. Any idea why?