Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssis 派生列表达式没有';不工作,但没有给出错误_Ssis_Derived Column - Fatal编程技术网

Ssis 派生列表达式没有';不工作,但没有给出错误

Ssis 派生列表达式没有';不工作,但没有给出错误,ssis,derived-column,Ssis,Derived Column,我正在尝试编写一个公式,根据报告期(varchar)计算基本交易金额(Int) 因此,如果报告期为201803,则表达式应评估该期间是否大于去年同月201701或小于去年下个月201702,或者是否介于今年的01和02之间,依此类推 我提出了下面的公式,它没有给我一个错误,但是当我运行包时,我在派生列中得到了0,而它应该是基本交易金额 PrevYear01列:(ReportingPeriod>=“Year(getdate()-1)”+“01”)&(ReportingPeriod=“Year(ge

我正在尝试编写一个公式,根据报告期(varchar)计算基本交易金额(Int)

因此,如果报告期为201803,则表达式应评估该期间是否大于去年同月201701或小于去年下个月201702,或者是否介于今年的01和02之间,依此类推

我提出了下面的公式,它没有给我一个错误,但是当我运行包时,我在派生列中得到了0,而它应该是基本交易金额

PrevYear01列:(ReportingPeriod>=“Year(getdate()-1)”+“01”)&(ReportingPeriod<“Year(getdate()-1)”+“02”)?BaseTransactionAmount:0

ThisYear01列:(ReportingPeriod>=“Year(getdate())”+“01”)&(ReportingPeriod<“Year(getdate())”+“02”)?BaseTransactionAmount:0


请帮忙

在连接之前,您可能需要强制转换计算年份:

(DT_WSTR,4)(year(getdate())-1) +"01"

在连接之前,您可能需要强制转换计算的年份:

(DT_WSTR,4)(year(getdate())-1) +"01"
非常确定
“Year(getdate()-1)”+“01”
是字符串concat。您需要添加它们,因此使用转换将其转换为I4/I8数据。此外,
Year(getdate()-1)
将生成昨天而不是去年。您可以尝试使用这个
Year(getdate())-1
非常确定
“Year(getdate()-1)”+“01”
是字符串concat。您需要添加它们,因此使用转换将其转换为I4/I8数据。此外,
Year(getdate()-1)
将生成昨天而不是去年。您可以尝试此
年份(getdate())-1