Look at substring and patindex and charindex and right. Basically you want to identify the location of the first space and use it to define the start of the substring and then find the locatiopn of the last space (using right to search from the end to the first space) and use that to define where to stop the substring.
Note that dennis's way is simpler but will only work if the exact text is always there. If the first and last chunk of text will vary then you need to use my method.
Some comments
declare a parameter like
@v ='test CSFB, ABN, C, BSC, BNPP, LEH, MER, BARX, BAS, FTN requests'
it won't work in my case because the list between test and requests could be different.
I need to identify when I found test and get rid off all I have on the left including test. I also need to search for requests and get rid off all I have to the right including requests. The final out put should be like this (not always the case)
CSFB, ABN, C, BSC, BNPP, LEH, MER, BARX, BAS, FTN
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.