简体   繁体   English

具有And Expression的SSRS开关需要帮助,第二个条件不成立

[英]SSRS Switch with And Expression need help , the second condition is not true

I need a help on the below Expression , I've 我需要以下Expression的帮助,

column A - Date, 

Column B-  Yes/No , 

Column C - Date.

Condition 条件

If Column B = Yes and Column A has a Date then text box in *Grey 如果Column B =是并且Column A具有日期,则文本框为*灰色

If Column A don't have Date, then check if Column C has date 如果Column A没有日期,请检查Column C是否有日期

then if Column C date > Today and Column B = No text box Green 然后,如果Column C日期> Today并且Column B =没有文本框,则绿色

If Column C date < Today and Column B = No text box Red 如果Column C日期< Today并且Column B =没有文本框红色

Also if there are no entries in any of the column then No color, 另外,如果该列中没有任何条目,则没有颜色,

I tried to put ISNOTHING(For all 3 columns) with And Operator before switch statement 我试图在开关语句之前用And运算符将ISNOTHING(对于所有3列)

Add your conditions as an expression in the font/color property of the required cell. 将条件作为表达式添加到所需单元格的font / color属性中。

=SWITCH(
    Fields![Column B].Value = "Yes" AND IsNothing(Fields![Column A].Value), "White",
    IsNothing(Fields![Column A].Value) and Fields![Column C].Value > Today() and Fields![Column B].Value = "", "Red",
    Fields![Column C].Value > Today() and Fields![Column B].Value = "Yes", "Gray",
    Fields![Column C].Value < Today(), "Green"
    )

First of all, it could not be the same what I'm providing you but you should try this, 首先,可能与我为您提供的内容不同,但是您应该尝试一下,

=
SWITCH
(
    CStr(Fields!ColumnB.Value) = "Yes" AND NOT(IsNothing(CDate(Fields!ColumnA.Value))), "Grey",
    IIF(IsNothing(Fields!ColumnA.Value),IIF(NOT(IsNothing(Fields!ColumnC.Value)),IIF(CDate(Fields!ColumnC.Value) > Today() AND Fields!ColumnB.Value="","")),"Green")
    CDate(Fields!ColumnC.Value) > Today() AND Fields!ColumnB.Value="Yes","Red"
    IsNothing(Fields!ColumnA.Value) AND IsNothing(Fields!ColumnB.Value) AND IsNothing(Fields!ColumnC.Value), ""
)

Also, if above doesn't work then try using separated IIF Statements. 另外,如果上述方法不起作用,请尝试使用单独的IIF语句。 It would be more easy. 这样会更容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM