I am trying to write an expression in a calculated field that shows if one date value is greater than another:
=(IIF(fields!date1.value>fields!date2.value,"late","on time")
This works fine when there is a value in fields!date2
.
However, if fields!date2.value
is blank, the expression returns "on time". I don't want it to do this, as date1
may be 1/4/15 - if date2
is blank, that mean's it's overdue and I therefore want the calculated field to say "late".
Therefore I want the expression to say "late" if fields!date1.value
is < today's date (basically, if it's blank and fields!date1.value
is before today's date, then it means it's overdue).
Can anyone advise on how to amend the expression to accommodate this?