0

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")
)
Jeff
  • 8,020
  • 34
  • 99
  • 157

2 Answers2

2

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

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

  • 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 Mar 17 '09 at 04:00
1

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

=iif(
    DateAdd("d", CInt(Fields!Days.Value), Fields!Date.Value) < Now, 
    "Red", "White")
Matt Hamilton
  • 200,371
  • 61
  • 386
  • 320