I'm writing an expression which needs to calculate the number of days between current report rundate and the date value in field (named cmp_lastap), then return a value of:
- "delinquent" if the number of elapsed days is
>= 60
, - "past due" if
>= 45
and<60
, - "due" if
>30
and<45
and - "current" if
<= 30
.
It seems that a nested IIF statement is what I need to use, but something is off and I can't figure out what I've done wrong:
=IIF(DateDiff(DateInterval.Day, Fields!cmp_lastap.Value, Today) >= 60,"DELINQUENT", IIF(DateDiff(DateInterval.Day, Fields!cmp_lastap.Value,Today) > 45 AND <60, "PAST DUE", IIF(DateDiff(DateInterval.Day, Fields!cmp_lastap.Value, Today) > 30 AND <=45, "DUE", IIF(DateDiff(DateInterval.Day, Fields!cmp_lastap.Value, Today) <= 30, "CURRENT")
Any help or suggestions for other expressions to accomplish this would be greatly appreciated!