I'm trying to create an expression that determines the shading of the field based on three factors. I thought using Switch to test various conditions would be the cleanest way to do this. The problem I run into is that when I add the third condition, the second condition stops working. If I remove the third condition, the second condition works just fine. It doesn't seem to matter what I use as the third condition, it causes the second condition to be skipped.
Condition 1: LOI_Signed is either 0 or 1, if it's 0 it means that I have a valid date in my "actual date" field and I want the shading to be Gainsboro.
Condition 2: If LOI_Signed is 1 then the date in LOI_Signed__A is actually a forecasted date and I want to verify that it is a valid date. If it is not then I want Gainsboro shading.
Condition 3: If it makes it to this point then it should be a valid, forecasted date so I want to test how close we are to it. If it's less than 30 days or no more 180 days past it, I want it Yellow.
Any help would be apprecated.
=Switch(Fields!LOI_Signed.Value = 0, "Gainsboro",
IsDate(Fields!LOI_Signed___A.Value) = 0, "Gainsboro",
DATEDIFF("d", Today, Me.Value) > -180 AND DATEDIFF("d", Today, Me.Value) < 30, "Yellow")