I have this conditional formatting expression (for background colour) which works fine:
=SWITCH(
Fields!Fire_Safety.Value = "F", "LimeGreen",
Fields!Fire_Safety.Value = "i", "Red",
Fields!Fire_Safety.Value = "E", "Yellow",
TRUE,Nothing
)
I have now changed the data table (via SQL) so that where the “F” was – there are now dates.
I changed the Switch expression (in SSRS) to this:
=SWITCH(
Fields!Fire_Safety.Value <= dateadd("d",90,Today()),"Orange",
Fields!Fire_Safety.Value >= dateadd("d",91,Today()),"LimeGreen",
Fields!Fire_Safety.Value = "i", "Red",
Fields!Fire_Safety.Value = "E", "Yellow",
TRUE,Nothing
)
And it fails. The date fields seem to work, but not the “i” and the “E”.
I guess it must be the syntax, but I’m a bit lost... Any ideas?
Fields!First_Aid.Valuetodateadd("d",90,Today()), then I assumeFirst_Aidis a date, in which case you cannot compare it to"i"or"e". I suspect you want to be comparingFire_Safetywith"i"and"e"in your 3rd and 4th conditions. - GarethD