Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Excluding Weekends and Holiays


Message #1 by brose@u... on Tue, 10 Jul 2001 21:28:07
I am running a query that finds the time a ticket in oracle was open. 

However, I need to take that total time and subtract the time of any 

weekend days or holidays that may have been between the open and close 

times of the record.



Is there any easy way to get the weekend days and holidays between two 

dates? I noticed a function in the help file of Access called NETWORKDAYS 

but when I try to use it Access doesn't recognize it as being a built in 

function. Can this function be installed? Is there a better way or 

alternative to it? Thanks for the help.
Message #2 by "Peter M. Kaufman" <kaufman@l...> on Sun, 15 Jul 2001 12:59:55
I can't see how any function could find holidays - that varies from 

country to country and even within countries. You'll have to put those in 

a table.



For weekdays, just use the weekday function.



Peter



> I am running a query that finds the time a ticket in oracle was open. 

> However, I need to take that total time and subtract the time of any 

> weekend days or holidays that may have been between the open and close 

> times of the record.

> 

> Is there any easy way to get the weekend days and holidays between two 

> dates? I noticed a function in the help file of Access called 

NETWORKDAYS 

> but when I try to use it Access doesn't recognize it as being a built in 

> function. Can this function be installed? Is there a better way or 

> alternative to it? Thanks for the help.
Message #3 by "Darron Michael" <darron.michael@h...> on Tue, 17 Jul 2001 13:55:31
Create a table named Holidays, with a date field for dates of holidays.



Create a function that when given two dates will query that table and 

return an integer number of the WORKING days between those dates.  You can 

address weekends by either putting them all in the holidays table or by 

having your function check for them using weekday().



Call that function from a query, feeding it the open and close dates.



HTH

8^)

Darron



> I am running a query that finds the time a ticket in oracle was open. 

> However, I need to take that total time and subtract the time of any 

> weekend days or holidays that may have been between the open and close 

> times of the record.

> 

> Is there any easy way to get the weekend days and holidays between two 

> dates? I noticed a function in the help file of Access called 

NETWORKDAYS 

> but when I try to use it Access doesn't recognize it as being a built in 

> function. Can this function be installed? Is there a better way or 

> alternative to it? Thanks for the help.

  Return to Index