IIf expression

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

I am trying to have an expression return "Expired" if the date difference is
over 30 days and if under 30 days, the number of days in the following
expression:

IIf(DateDiff(“dâ€,[CommitteeDate],Now()>30),â€Expiredâ€,(DateDiff(“dâ€,[CommitteeDate],Now())))

Of course it does not work. Any Ideas where I am going wrong?
 
i agree with AccessVandal, my only additional notes being that 1) you have
an extra set of parentheses that you don't need, around the last argument
and 2) Now() returns current date AND time whereas Date() returns current
date only. unless time is a factor in this situation, try

IIf(DateDiff("d",[CommitteeDate],Date())>30,"Expired",DateDiff("d",
[CommitteeDate],Date()))

hth
 
Back
Top