FINDSTRING RIGHT in Derived Column in SSIS
HI, I've tried to do this myself but at 2am I've decided I'm stuck. I have some data like: 00/01/IE10/586009 00/05/IE10/586009 00/01/GB11/58600987 00/10/GB11/1234567899 What I'd like to import is simply the Customer Number, which are the final set of number on the right. They can differ in length but are always after the third / Can some one please help with my Findstring. The name of the field is CL3 and I'm using SQL 2005 many thanks
February 25th, 2012 9:10pm

SUBSTRING(CL3,FINDSTRING(CL3,"/",3)+1,40) May have to adjust the 40, to the length of CL3
Free Windows Admin Tool Kit Click here and download it now
February 25th, 2012 10:06pm

no need for fixed length, use this expression this will return characters from 3rd slash to end of statement: substring(CL3,findstring(CL3,"/",3)+1,Len(CL3)-findstring(CL3,"/",3))http://www.rad.pasfu.com
February 25th, 2012 10:15pm

Hi, I have tested with ur data using the below and it worked. reverse(substring(reverse(CL3),1,charindex('/',reverse(CL3))-1))Srikrishna
Free Windows Admin Tool Kit Click here and download it now
February 25th, 2012 11:07pm

You could use this as well RIGHT(CustomerNo,LEN(CustomerNo) - FINDSTRING(CustomerNo,"/",3)) Replace the CustomerNo with your column name in the query Murali
February 26th, 2012 12:19am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics