Queries in Access - Overdue Dates

J

jchollo

I created a action log database and I have a field named Due Dates.
named another field Overdue Dates which is currently blank.

I the Due Dates are past due, I want in the Overdue Dates field to say
1 day past due, 2 days past due, etc. in red.

How would I do the query for this?

tk
 
J

John Vinson

I created a action log database and I have a field named Due Dates. I
named another field Overdue Dates which is currently blank.

I the Due Dates are past due, I want in the Overdue Dates field to say,
1 day past due, 2 days past due, etc. in red.

How would I do the query for this?

The Overdue Dates field SHOULD NOT EXIST in your table.

Instead, calculate it on the fly in a Query with an expression such as

Switch(DateDiff("d", [Due Dates], Date()) <= 0, "",
DateDiff("d", [Due Dates], Date()) = 1, "1 day past due",
True, DateDiff("d", [Due Dates], Date()) & " days past due")


John W. Vinson[MVP]
 
Top