Group:  Microsoft Access » microsoft.public.access.formscoding
Thread: Need Help with Calculating Dates

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Need Help with Calculating Dates
Larry G 22.09.2006 01:44:01


Our client will provide us with a “cycle start date”, each cycle has a
total of 9 release dates, the first release date is in fact the cycle’s start
date, in turn we have to calculate 8 additional dates. Each of the 8
subsequent dates must be in intervals of 10 workdays, however if the intended
date falls on a Saturday the release date is advanced to Friday, if the
release date falls on a Sunday the release date is extended to Monday and if
the release day falls on a holiday the release date is extended to the next
workday.

Lets pretend that our holiday schedule is:
New Years Day, 4th of July, Thanksgiving, Christmas

Using the following sample code I have figured out how I can calculate the 8
subsequent dates however despite finding some articles about how to
manipulate dates, I’m totally lost when it comes to how write the code to
extract Saturdays, Sundays and Holidays.

Private Sub Form_Current()


Del1 = DateAdd("d", 10, [CStartDate])
Del2 = DateAdd("d", 10, [Del1])
Del3 = DateAdd("d", 10, Del2)
End Sub

Since I’m not very skilled with code. Kindly include all the necessary
keystrokes in any recommendations you may provide.

Thanks in advance for any comments or suggestions.

Regards,

Larry G.

RE: Need Help with Calculating Dates
Ray Cacciatore 22.09.2006 20:09:02
Check if this link can help you out a bit:
http://www.pacificdb.com.au/MVP/Code/Dates.htm

Ray

"Larry G" wrote:

[Quoted Text]
>
>
> Our client will provide us with a “cycle start date”, each cycle has a
> total of 9 release dates, the first release date is in fact the cycle’s start
> date, in turn we have to calculate 8 additional dates. Each of the 8
> subsequent dates must be in intervals of 10 workdays, however if the intended
> date falls on a Saturday the release date is advanced to Friday, if the
> release date falls on a Sunday the release date is extended to Monday and if
> the release day falls on a holiday the release date is extended to the next
> workday.
>
> Lets pretend that our holiday schedule is:
> New Years Day, 4th of July, Thanksgiving, Christmas
>
> Using the following sample code I have figured out how I can calculate the 8
> subsequent dates however despite finding some articles about how to
> manipulate dates, I’m totally lost when it comes to how write the code to
> extract Saturdays, Sundays and Holidays.
>
> Private Sub Form_Current()
>
>
> Del1 = DateAdd("d", 10, [CStartDate])
> Del2 = DateAdd("d", 10, [Del1])
> Del3 = DateAdd("d", 10, Del2)
> End Sub
>
> Since I’m not very skilled with code. Kindly include all the necessary
> keystrokes in any recommendations you may provide.
>
> Thanks in advance for any comments or suggestions.
>
> Regards,
>
> Larry G.
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net