Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date comparison syntax 1

Status
Not open for further replies.

mjd3000

Programmer
Apr 11, 2009
136
GB
I am trying to change the backcolor of a cell on the condition that the value in a date field is less than Now. Does anybody know what I am doing wrong?

=IIF(Fields!End_Date < Now, "DarkRed", "White")
 
Are they in the same format? You may want to use DateValue() on teh End_Date. Are you getting an error or is it just not working for you?

--------------------------
Web/.net Programmer & DBA
Central PA
 
Code:
=IIF(Fields!End_Datep[b][COLOR=#ff0000].Value[/color][/b] < Now, "DarkRed", "White")
 
Oops. I figured it out. Add ".Value." Try:

Code:
=IIF(Fields!End_Date.Value < Now, "DarkRed", "White")

--------------------------
Web/.net Programmer & DBA
Central PA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top