Share via

Status based on dates

Anonymous
2023-09-28T23:50:40+00:00

I am trying to write a Status expression for In Process, Overdue, and Completed based on date differences Here is what I tried

=IIf([DueDate]<Date(),"Overdue",IIf([DueDate]>=Date(),"Inprocess",IIf([CompleteDate] Is Not Null,"Completed")))

The only one working correctly id the Complete data status

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

ScottGem 68,810 Reputation points Volunteer Moderator
2023-09-29T00:34:35+00:00

The expression says:

IF The DueDate is earlier than the current date, then sow Overdue

Else, if the DueDate is equal to or greater than the current date, then show In process.

Else, If the Completed Date isn't Null show Completed

However since the DueDate must be either earlier than the current date or greater/equal it will never get to the third condition.

I would try:

IIF(NOT IsNull(CompleteDate), "Completed", IIF(Duedate<Date(),"Overdue", "InProcess"))

This says if completed date is filled in show Completed,

Else If Duedate earlier than current Date show Overdue

Else show InProcess

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-09-29T02:20:50+00:00

    Yes, I believe that is correct

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,810 Reputation points Volunteer Moderator
    2023-09-29T02:12:55+00:00

    Do you have the expression as the Control source?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-09-29T02:07:13+00:00

    I di have one question. The In-process status shows up in the field for a new record is there a way to keep that blank?

    IIF(NOT IsNull(CompleteDate), "Completed", IIF(Duedate<Date(),"Overdue", "InProcess"))

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-09-29T00:55:49+00:00

    That was awesome! Thank you for also explaining the logic and fallacy with the way I had written the expression. I truly appreciate the help!

    Was this answer helpful?

    0 comments No comments