views:

1064

answers:

2

I'm trying to add days to a date and then compare to see if it's outside a range to color code a cell. It's not working--I think I may be making a simple syntax error.

iif(
  (DateAdd("d", CInt(Fields!Days.Value), Fields!Date.Value) < Now), "Red", "White")
)
+1  A: 

Are you starting your expression with an "=" sign?

=iif(
    DateAdd("d", CInt(Fields!Days.Value), Fields!Date.Value) < Now, 
    "Red", "White")
Matt Hamilton
+2  A: 

It looks like you have an extra ")" at the end.

=iif((DateAdd("d", CInt(Fields!Days.Value), Fields!Date.Value) < Now), "Red", "White")

Ricky Allman
That's true! I hadn't noticed that. I removed the inner parentheses in my own answer but left his extra one on the end. I'll edit my response to reflect that. Good pick-up.
Matt Hamilton