在SSRS 2017中使用此公式时出现错误:
没有为类型'integer'和'System.TimeSpan'定义运算符'/'
未为类型'System.TimeSpan'和'System.TimeSpan'定义运算符'*'
=IIF(
100 / (DateAdd("d", -(Day(Today)), Today) -
DateSerial(Year(DateAdd("m", -1, Now())), 1, 1)
)
* ((Today - DateSerial(Year(DateAdd("m", -1, Now())), 1, 1)) / 100) > 1,
1,
100 / (DateAdd("d",-(Day(Today)), Today) -
DateSerial(Year(DateAdd("m", -1, Now())), 1, 1)
)
* ((Today - DateSerial(Year(DateAdd("m", -1, Now())), 1, 1)) / 100)
)
答案 0 :(得分:0)
使用DateDiff()
代替-
:
=IIF(
100 / DateDiff("d", DateAdd("d", -Day(Today), Today),
DateSerial(Year(DateAdd("m", -1, Now())), 1, 1)
)
* (DateDiff("d", Today, DateSerial(Year(DateAdd("m", -1, Now())), 1, 1)) / 100) > 1,
1,
100 / DateDiff("d", DateAdd("d",-(Day(Today)), Today),
DateSerial(Year(DateAdd("m", -1, Now())), 1, 1)
)
* DateDiff("d", Today, DateSerial(Year(DateAdd("m", -1, Now())), 1, 1)) / 100
)