X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Add Or Subtract A Number Of Business Days To A Date, Any Version    
Candace Tripp
post May 31 2002, 08:17 AM

UA Admin & Utter Angel
Posts: 3,039
Joined: 30-January 00
From: Virginia, USA

This procedure relies on the existence of a "Holidays" table. See the methods below for the HolidayTableFill() procedure for details on creating, filling, and using this table.
Returns: original date plus the number of business added or subtracted
Sub AddBusinessDays()
' ==============================================
' Example code for AddBusinessDays()
' Adds or subtracts business days to a given
' date. Weekends and holidays are not counted.
' Relies on a Holidays table listing the
' non-weekend holiday dates. To create the
' Holidays table, see the HolidayTableFill procedure.
' ==============================================
' Assuming the Holidays table exists and contains
' Dec. 25, 1997 (Christmas) and Jan. 1, 1998
' (New Year's) this routine calculates the 7
' business days from Dec. 23.
Dim datNewDate As Date
datNewDate = AddBusinessDays(#12/23/97#, 7, "Holidays", "Date")
MsgBox "7 business days after 12/23/97 is " & datNewDate
End Sub
Attached File(s)
Attached File  95181.zip ( 2.79K )Number of downloads: 38
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    17th October 2018 - 03:20 AM