SSIS expression

2019-07-13 01:02发布

Anybody have any idea why this SSIS expression is not working

The derived column name is from_service_date_yyyymmdd

The expression is

(DT_STR,4,1252)from_service_date_yyyy + RIGHT("0" + (DT_STR,2,1252)from_service_date_mm,2) + RIGHT("0" + (DT_STR,2,1252)from_service_date_dd,2)

from_service_date_yyyy, from_service_date_mm and from_service_date_dd all have valid values

The output from the derived column transformation does not have from_service_date_yyyymmdd. I can't figure out why.

1条回答
成全新的幸福
2楼-- · 2019-07-13 01:43

your expression looks fine, but you missed the brackets in the columns names, and you have to cast columns to DT_WSTR instead of DT_STR because RIGHT() function result is of type DT_WSTR, and cast the whole result to DT_DTR if needed

(DT_WSTR,8,1252)((DT_WSTR,4)[from_service_date_yyyy] + RIGHT("0" + 
(DT_WSTR,2)[from_service_date_mm],2) + RIGHT("0" + 
(DT_WSTR,2)[from_service_date_dd],2))
查看更多
登录 后发表回答