开发者

Help with SubString in SSIS

开发者 https://www.devze.com 2023-02-17 16:34 出处:网络
Hallo All, I have a little Problem with the SubString-Function in SSIS (Derived Column). So on.. That are the possible Input Strings:

Hallo All,

I have a little Problem with the SubString-Function in SSIS (Derived Column).

So on..

That are the possible Input Strings:

Toys|Category|Cars|Lego

Toys|Hot&New|Girls&Lifestyle|Doll

Toys|New

Barbies|Category|Mobile

I need to filter the word after the Second " | ".

In first case: "Cars"

In the second case: "Girls&Lifestyle"

In the third case: ""

In the fourth case: "Mobile"

My try was: SUBSTRING(Category,FINDSTRING(Category,"|",2)+1,FINDSTRING(Category,"|",3))

It doesn't work because开发者_如何学JAVA the FINDSTRING(Category,"|",3) gives the index but I need the lenght of the Word!! How can i count the Characters of a word in a String?

Thank you for your Help and Sorry for my bad english!!

Best Regards Alex


This should do what you want...a touch messy though!

SUBSTRING( Category, FINDSTRING( Category, "|", 2 )+1,FINDSTRING( Category, "|", 3 )-FINDSTRING( Category, "|", 2 )-1)
0

精彩评论

暂无评论...
验证码 换一张
取 消