fthomas1973
MIS
I have a substring that I am trying to work out
Here is the source data pattern.
8HTD9R||
or
8HTD9R|||
or
1S494PX|1O00J2U||
I have taken the value before the first | and pulled it into a column.
I need to pull the value between two pipes into another column. In the example above I can’t figure out how to pull 1O00J2U into a column and leave it null if there is nothing there. This is close but not exactly what I want. It doesn't ignore the | that trail
Thanks
Here is the source data pattern.
8HTD9R||
or
8HTD9R|||
or
1S494PX|1O00J2U||
I have taken the value before the first | and pulled it into a column.
Code:
(SELECT LEFT(SU_Value3, CHARINDEX('|',(SU_Value3))-1)) AS IDX
I need to pull the value between two pipes into another column. In the example above I can’t figure out how to pull 1O00J2U into a column and leave it null if there is nothing there. This is close but not exactly what I want. It doesn't ignore the | that trail
Code:
(SELECT RIGHT(RTRIM(SU_Value3), PATINDEX('%|%',(SU_Value3))+1)) AS WORKFLOW
Thanks