Due Dates That Fall on Weekend

  • Thread starter Thread starter Julie Gilliam
  • Start date Start date
J

Julie Gilliam

Can someone please tell me what I need to do to make any due date that falls
on a Saturday or Sunday default back to Friday.

I need very specific instructions as I have tried to do this for several
years and can not get it to work properly.

Thanks Julie
 
For a specific answer, we might need some more details. Is a user
entering a date on a form that needs to be verified at that time? Is
the due date being calculated based on a different date?

It won't be too hard to do though. You can use the Weekday() function
and the DateAdd() function. Post a few more details and we'll help ya
out.

You can use logic like this:

if Weekday([duedate]) = 7 then
[duedate] = DateAdd("d", -1, [duedate]
elseif Weekday([duedate]) = 1 then
[duedate] = DateAdd("d", -2, [duedate]
end if
 
An expression like the following should work to calculate the desired date.

IIF(Weekday([SomeDate],2)>5,DateAdd("d",5-Weekday([SomeDate],2),[SomeDate]),[SomeDate])

That will work in a query as a calculated field. Elsewhere it may fail if
SomeDate is ever null.


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top