Showing posts with label column11. Show all posts
Showing posts with label column11. Show all posts

Wednesday, March 21, 2012

Need some help writing part of the derived column component

Hey. I need to see if "/" is present in the column11 and if it's then just pass it as is or do the substring part. How do I get this to work? It's giving me an error. This is for a TimeDate column. I can get a 20060813 or 2006/08/13.I'm using the below and it's giving me an error saying that It should be DT_BOOL and I'm trying to return DT_I4.

findstring(Column11,"/",2) ? Column11 : SUBSTRING(TRIM(Column11),1,4) + "-" + SUBSTRING(TRIM(Column11),5,2) + "-" + SUBSTRING(TRIM(Column11),7,2)

Thank you

Tej

Tej,

Your test should be: findstring(Column11,"/",2)!=0 . You're testing for true or false(Boolean). findstring returns the location of the string to be found.

Frank

|||

Hey Frank. I tried (dt_bool)findstring(Column11,"/",2)

Is that correct or an error? Please let me know. I'll use what you asked me to in this case but just wanted to make sure. Thank you.

|||

Yes, that will work also.

Frank