If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date field question
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 |
#2
|
|||
|
|||
Date field question
[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" wrote: 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 |
#3
|
|||
|
|||
Date field question
On Wed, 1 Jul 2009 13:39:01 -0700, Bob Waggoner wrote:
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])) -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#4
|
|||
|
|||
Date field question
Absolutely works! Thank you! Awesome.
"KARL DEWEY" wrote: [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" wrote: 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 |
#5
|
|||
|
|||
Date field question
Thank you!
"fredg" wrote: On Wed, 1 Jul 2009 13:39:01 -0700, Bob Waggoner wrote: 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])) -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#6
|
|||
|
|||
Date field question
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" wrote in message ... 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 |
#7
|
|||
|
|||
Date field question
Thanks, Jeff. I've taken your advice and added them to my favorites list. I
Appreciate the help. Bob "Jeff Boyce" wrote: 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" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|