A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date field question



 
 
Thread Tools Display Modes
  #1  
Old July 1st, 2009, 09:39 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default 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  
Old July 1st, 2009, 10:20 PM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old July 1st, 2009, 10:21 PM posted to microsoft.public.access.tablesdbdesign
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old July 1st, 2009, 10:38 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default 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  
Old July 1st, 2009, 10:39 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default 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  
Old July 2nd, 2009, 12:08 AM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default 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  
Old July 7th, 2009, 05:39 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.