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. >
|