0

Hi i have 2 conditions for a column in an SSRS report.

if Expirationdate <= Begdate  then red 
if Begdate <Expirationdate<Enddate then orange
else white.

This is what i have currently.

=iif((Fields!EXPIRATIONDATE.Value <= Parameters!BEGDATE.Value), "Red"
,iif((Fields!LICENSENUM.Value<Parameters!BEGDATE.Value) and (Fields!LICENSENUM.Value>Parameters!ENDDATE.Value)) , "Orange","White")

is there something i am doing wrong?

T Dang
  • 157
  • 3
  • 17
  • Could you explain what is happening that is Wrong? You haven't expressed what the problem is – Pants Jun 29 '17 at 15:35
  • @ChanceFinley Sorry with my current FX my report is not building . I get an overload resolution failed because no accesible 'iif' accepts this number of arguments. – T Dang Jun 29 '17 at 15:42
  • I would recommend using switch instead of nested IIF. The ELSE can be emulated by setting the last expression to always true. For example: https://stackoverflow.com/questions/18538222/ssrs-conditional-formatting-switch-or-iif – niktrs Jun 30 '17 at 05:45

1 Answers1

0

I think you have too many IIFs and brackets.

Try this:

=iif(Fields!EXPIRATIONDATE.Value <= Parameters!BEGDATE.Value, "Red", iif(Fields!LICENSENUM.Value < Parameters!BEGDATE.Value and Fields!LICENSENUM.Value > Parameters!ENDDATE.Value , "Orange", "White"))
Alex K
  • 16