增加四分之一个月来表达

时间:2016-05-19 06:54:36

标签: reporting-services ssrs-expression

我需要添加到此表达式。

=IIF(cstr(Fields!MainIndicator.Value) IS Nothing," ",Fields!Netincome.Value)

如果字段MainIndicator Value为NULL,则当前隐藏数据。

但是,如果月份是3月,6月,9月,12月,我想显示数据

有人可以提供建议吗?

3 个答案:

答案 0 :(得分:0)

你几乎就在那里:

IIF(CSTR(Fields!MainIndicator.Value) = "Mar" 
OR CSTR(Fields!MainIndicator.Value) = "Jun" 
OR CSTR(Fields!MainIndicator.Value) = "Sep" 
OR CSTR(Fields!MainIndicator.Value) = "Dec" ,Fields!Netincome.Value," ")

修改: 您添加了更改注释的更多注释(它不清楚您要求的内容)。 尝试:

IIF(MonthName(CDATE(Fields!MainIndicator.Value)) = "March" 
OR MonthName(CDATE(Fields!MainIndicator.Value)) = "June" 
OR MonthName(CDATE(Fields!MainIndicator.Value)) = "September" 
OR MonthName(CDATE(Fields!MainIndicator.Value)) = "December" ,Fields!Netincome.Value," ")

答案 1 :(得分:0)

试试这个:

=Switch( IsNothing(Fields!MainIndicator.Value), ""
, Month(Fields!MainIndicator.Value) = 3, Fields!Netincome.Value
, Month(Fields!MainIndicator.Value) = 6, Fields!Netincome.Value
, Month(Fields!MainIndicator.Value) = 9, Fields!Netincome.Value
, Month(Fields!MainIndicator.Value) = 12, Fields!Netincome.Value
, True, ""
)

答案 2 :(得分:0)

我终于解决了这个问题。我错过了真实的部分=switch(IsNothing(Fields!MainIndicator.Value), " ", isnothing(Fields!Netincome.Value), "-", true Fields!Netincome.value)