SSRS日期老化表达0-30天

时间:2015-04-15 18:54:16

标签: tsql reporting-services expression ssrs-expression

我正在研究老化报告BI Project,我对这些表达式感到困惑。我试图在NOW()和日期字段之间计算应用程序的数量。我得到了倒数,但不是日期范围内的申请总数。

0-30 DAYS

=iif(DateDiff("d",Fields!APP_RECEVIED.Value, now())>=0 and DateDiff("d",Fields!APP_RECEVIED.Value,Now())<=30,1,0)

31-60天

=iif(DateDiff("d",Fields!APP_RECEVIED.Value, now())>=31 and DateDiff("d",Fields!APP_RECEVIED.Value,Now())<=60,1,0)

61-90天

=iif(DateDiff("d",Fields!APP_RECEVIED.Value, now())>=61 and DateDiff("d",Fields!APP_RECEVIED.Value,Now())<=90,1,0)

&gt; 91天

=iif(DateDiff("d",Fields!APP_RECEVIED.Value, now())>=91 and DateDiff("d",Fields!APP_RECEVIED.Value,Now())<=99999999,1,0)

谢谢, 阿龙

1 个答案:

答案 0 :(得分:0)

使用执行SQL任务调用为您执行这些计算的脚本。在SSMS中编写脚本,测试它并确保数据返回您需要的内容,然后将其放入任务中。 SQL非常擅长这一点。