Date field question

B

Bob Waggoner

I have PMs that are due - sometimes within 1 day and sometimes within 3 days.
I record the date done and have a query extract the next due date. When that
falls on a weekend, how do I get the date to advance to the following Monday
for a due date? Here's my code now.
Due Date: (([MaxOfDateDone]+[FreqDays]))
Thanks
 
K

KARL DEWEY

[Try this --
IIf(Weekday([MaxOfDateDone]+[FreqDays]) Between 2 And
6,[MaxOfDateDone]+[FreqDays],IIf(Weekday([MaxOfDateDone]+[FreqDays]+1)
Between 2 And 6,[MaxOfDateDone]+[FreqDays]+1,[MaxOfDateDone]+[FreqDays]+2))
 
F

fredg

I have PMs that are due - sometimes within 1 day and sometimes within 3 days.
I record the date done and have a query extract the next due date. When that
falls on a weekend, how do I get the date to advance to the following Monday
for a due date? Here's my code now.
Due Date: (([MaxOfDateDone]+[FreqDays]))
Thanks

Add 2 days if the resulting date is a Saturday, add 1 day of the
resulting date is a Sunday.
Perhaps this will help:

DueDate: IIf(Weekday([ADate]+[FreqDays])=7,([ADate]+[FreqDays])+2,
IIf(Weekday([ADate]+[FreqDays])=1,([ADate]+[FreqDays])+1,[ADate]+[FreqDays]))
 
B

Bob Waggoner

Absolutely works! Thank you! Awesome.

KARL DEWEY said:
[Try this --
IIf(Weekday([MaxOfDateDone]+[FreqDays]) Between 2 And
6,[MaxOfDateDone]+[FreqDays],IIf(Weekday([MaxOfDateDone]+[FreqDays]+1)
Between 2 And 6,[MaxOfDateDone]+[FreqDays]+1,[MaxOfDateDone]+[FreqDays]+2))

Bob Waggoner said:
I have PMs that are due - sometimes within 1 day and sometimes within 3 days.
I record the date done and have a query extract the next due date. When that
falls on a weekend, how do I get the date to advance to the following Monday
for a due date? Here's my code now.
Due Date: (([MaxOfDateDone]+[FreqDays]))
Thanks
 
B

Bob Waggoner

Thank you!

fredg said:
I have PMs that are due - sometimes within 1 day and sometimes within 3 days.
I record the date done and have a query extract the next due date. When that
falls on a weekend, how do I get the date to advance to the following Monday
for a due date? Here's my code now.
Due Date: (([MaxOfDateDone]+[FreqDays]))
Thanks

Add 2 days if the resulting date is a Saturday, add 1 day of the
resulting date is a Sunday.
Perhaps this will help:

DueDate: IIf(Weekday([ADate]+[FreqDays])=7,([ADate]+[FreqDays])+2,
IIf(Weekday([ADate]+[FreqDays])=1,([ADate]+[FreqDays])+1,[ADate]+[FreqDays]))
 
J

Jeff Boyce

Here in the USA, this coming Friday is an observed holiday. How would you
want the function/routine to handle that?

Some holidays are observed on a Monday. How would you want the
function/routine to handle that?

Consider taking a look at mvps.org/access to see about a WorkDays()
function -- it may offer ideas toward what you're working on.


Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

Bob Waggoner

Thanks, Jeff. I've taken your advice and added them to my favorites list. I
Appreciate the help.
Bob

Jeff Boyce said:
Here in the USA, this coming Friday is an observed holiday. How would you
want the function/routine to handle that?

Some holidays are observed on a Monday. How would you want the
function/routine to handle that?

Consider taking a look at mvps.org/access to see about a WorkDays()
function -- it may offer ideas toward what you're working on.


Regards

Jeff Boyce
Microsoft Office/Access MVP

Bob Waggoner said:
I have PMs that are due - sometimes within 1 day and sometimes within 3
days.
I record the date done and have a query extract the next due date. When
that
falls on a weekend, how do I get the date to advance to the following
Monday
for a due date? Here's my code now.
Due Date: (([MaxOfDateDone]+[FreqDays]))
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top