Sunday, March 11, 2012

Convert String to Numeric

Hi all,

I defined an user string type varible in the package as AccountLen. I am trying to use this varible in the Expression of Derived Column transformation.

I want to retrieve a part of column, i.e: Right(Column1, @.AccountLen), this is always wrong because the AccountLen is string type. How I can convert it to the numeric so that can be used in the RIGHT function?

Thanks

To convert a string to numeric you CAST the field.

(DT_I4)@.[User::AccountLen]

However, I don't believe that will work as I don't believe most functions accept variables as input parameters.

|||

Thank you very much. Your solution is working fine.

No comments:

Post a Comment