Probelm with redirecting error rows in Derived column to another derived column
I have a Date field with values 'YYYYMMDD' format for few rows and no value for few rows. In the derived column 'A' I'm using the below expression to change the format of the Date field. SUBSTRING([DATE],1,4) + "-" + SUBSTRING([DATE],5,2) + "-" + RIGHT([DATE],2) My package is getting failed since few rows doesn't have value for Date. So, I took one more Derived column 'B' and redirecting the error rows from derived column 'A' to Derived column 'B'. In Derived column 'B' I'm replacing the no value with variable which will have the current date. But still my package is getting failed because of "POTENTIAL LOSS OF DATA" . Please help me. Can I use iif condition to check if the value existed in the derived column ?
June 30th, 2011 12:43pm

You'd need to post more specific information for us to help you with the truncation problem (the "potential loss of data"). However, you should be able to handle this entirely in one Derived Column with a slightly more complex expression, using an IIF equivalent: (ISNULL([DATE]) || (LEN(TRIM([DATE])) == 0)) ? @[User::DefaultDate] : SUBSTRING([DATE],1,4) + "-" + SUBSTRING([DATE],5,2) + "-" + RIGHT([DATE],2) Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
June 30th, 2011 12:53pm

It worked. Thanks.
June 30th, 2011 1:13pm

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

Other recent topics Other recent topics