SSIS派生列表达式-删除前导零
我有一个包由于带有数字字符串的负号而失败,例如: 000000000-25.00 派生列表达式为:SSIS派生列表达式-删除前导零,ssis,Ssis,我有一个包由于带有数字字符串的负号而失败,例如: 000000000-25.00 派生列表达式为: ISNULL(wstr_Payment_Amount) || TRIM(wstr_Payment_Amount) == "" ? (DT_CY)0 : (DT_CY)wstr_Payment_Amount 列的数据类型为money。我在派生列上重定向了一行,以确认导致失败的是负号 这是我的 FINDSTRING(wstr_Payment_Amount, "-", 1) >0 ? TRIM
ISNULL(wstr_Payment_Amount) || TRIM(wstr_Payment_Amount) == "" ? (DT_CY)0 : (DT_CY)wstr_Payment_Amount
列的数据类型为money。我在派生列上重定向了一行,以确认导致失败的是负号
这是我的
FINDSTRING(wstr_Payment_Amount, "-", 1) >0 ? TRIM(SUBSTRING(wstr_Payment_Amount, FINDSTRING(wstr_Payment_Amount, "0-", 1), 8)) : wstr_Payment_Amount
我正在使用SSIS 2008如果您使用的是两个派生列,请将其作为字符串保留在第一个列中
ISNULL(wstr_Payment_Amount) || TRIM(wstr_Payment_Amount) == "" ? (DT_WSTR,100)"0" : (DT_WSTR,100)wstr_Payment_Amount
我认为你真的很亲近,但是一旦你发现了负面的迹象……
FINDSTRING(wstr_Payment_Amount, "-", 1) >0 ? (DT_CY) ("-" + replace(wstr_Payment_Amount,"-","")) : (DT_CY)wstr_Payment_Amount
这只会将“-”移到前面,所有的零都会消失。谢谢Keith!它工作得很好。我刚刚添加了ISNULL(wstr_Payment_Amount)| | TRIM(wstr_Payment_Amount)==”,以解释null或空白。。谢谢你的帮助!