Take a look at: http://www.access.mvps.org/access/datetime/date0006.htm
Access days calculation between two date exclude weekeng and holidays
Hello, we have the following query statement to calculate the days between two date excluding weekend.
DateValue(Format([Due Date],"mm/dd/yyyy"))-[Order Date]+1-(DateDiff("ww",[Order Date],DateValue(Format([Due Date],"mm/dd/yyyy")),7)-(Weekday([Order Date])=7))-(DateDiff("ww",[Order Date],DateValue(Format([Due Date],"mm/dd/yyyy")),1)-(Weekday([Order Date])=1))
This query statement exclude weekend only. In addition, that I can add to this statement that I also exclude holidays? Thanks
Microsoft 365 and Office | Access | For home | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
4 answers
Sort by: Most helpful
-
Anonymous
2015-12-01T18:39:43+00:00 -
Anonymous
2015-12-02T15:47:28+00:00 Hello Daniel,
It would be possible to send me all programming of the query without the comments, so that I may give you copy and paste. Thanks
-
Anonymous
2015-12-04T15:02:52+00:00 It is posible to send me the exact code statement wihtout comment? Thanks
-
ScottGem 68,775 Reputation points Volunteer Moderator
2015-12-04T16:39:37+00:00 Joe,
You can't do this with a statement. You have to use a User Defined function that you pass values to. The links Daniel gave you are to functions that will work for you. You need to review the code and choose the function that will work best for you. To exclude Holidays you need to have a table of holidays to check against.
You need to copy the code you choose into a global module, then use the function to return the number of days.