SSIS表达式 [英] SSIS expression
问题描述
派生列名称为 from_service_date_yyyymmdd
表达式是
(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
和 from_service_date_dd
都具有有效值
派生列转换的输出没有 from_service_date_yyyymmdd
。我不知道为什么。
你的表情看起来不错,但是你错过了列名中的方括号,而你由于 RIGHT()$ c $,因此必须将列转换为
DT_WSTR
而不是 DT_STR
c>函数结果是键入 DT_WSTR
,并将整个结果转换为 DT_DTR
如果需要
(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))
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.
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))
这篇关于SSIS表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!