Link to home
Start Free TrialLog in
Avatar of John (Yiannis) Toutountzoglou
John (Yiannis) ToutountzoglouFlag for Greece

asked on

Matrix Background Color

Common Question But i can not understand what is going on!!
in My Matrix The Value TextBox is a date Field=FORMAT(MAX(Fields!Expr1.Value),"dd-MM-yyyy")
What i want to do is
1.when the value ="" then Color White
2.When Value Less than today Color Red
3.10 Days Before today Yellow..
Finnaly When Value>=Today Color Green
SO far ..
The Result Of my code is that there are no Greens Even if i have Values >today and i have yellows without any Values in Range
=IIF(FORMAT(MAX(Fields!Expr1.Value),"dd-MM-yyyy") = "","White",
     IIF(
         FORMAT(MAX(Fields!Expr1.Value),"dd-MM-yyyy")<Format(Today,"dd-MM-yyyy"),"Red",
                IIF(
                   FORMAT(MAX(Fields!Expr1.Value),"dd-MM-yyyy")<Format(DateAdd("d",-10,today),"dd-MM-yyyy"),"Yellow",
                    "Green"
       
        )            
      ) 
   )

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John (Yiannis) Toutountzoglou

ASKER

You are very very right...Just a few Correction Because Length is not member of  expression i use Len instead..
And i Replace Is Not with Is
=IIF(Fields!Expr1.Value is Nothing AndAlso Len(Fields!Expr1.Value) = 0,"White",
	IIF(CDate(MAX(Fields!Expr1.Value)) < Today, "Red",
		IIf(CDate(MAX(Fields!Expr1.Value)) < DateAdd("d", -10, Today), "Yellow", "Green")))

Open in new window

Thank you very much Kaufmed
NP.  Glad to help  :)