473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Working Days Excluding Saturdays, Sundays and Holidays in a given period.

I want to calculate working Days Excluding Saturdays and Sundays in a given period.

I have the following queri statement to exclude saturday and sunday:

Expand|Select|Wrap|Line Numbers
  1. System Test Working Days LT: (
  2.    ([Testing End Date]-[Sample Received Date])
  3.    +(Weekday([Sample Received Date])-1)
  4.    -(Weekday([Testing End Date])-1))
  5.    *5/7-1
  6.    +IIf((Weekday([Testing End Date])-1)-1>5,
  7.       5,
  8.       (Weekday([Testing End Date])-1))
  9.    -IIf((Weekday([Sample Received Date])-1)>5,
  10.       5,
  11.       (Weekday([Sample Received Date])-1)-1)
I need add the statement to exclude Holiday. Please give me the specific code or statement. Copy and paste. Thanks
Dec 3 '15 #1
3 990
mbizup
80 64KB
<<. Please give me the apecifict code or statement. Copy and paste. >>

It's not quite that simple.

To do this, you need to define what days are holidays (these of course differ between countries, employers, etc), by setting up a table of holidays.

Read this article about calculating working days. It contains a sample that you should be able to apply to your own database.
https://msdn.microsoft.com/en-us/lib...ffice.12).aspx
Dec 3 '15 #2
Seth Schrock
2,965 Expert 2GB
Here is a link that describes how to list the holidays that you want excluded and also exclude the weekend: Counting the Number of Working Days
Dec 3 '15 #3
NeoPa
32,556 Expert Mod 16PB
SantiagJ:
Please give me the specific code or statement. Copy and paste. Thanks
As that is specifically prohibited it's lucky this question doesn't lend itself to such a simple approach.

Perhaps it's not such a great idea to advertise that you aren't even expecting to do any of the work yourself when asking for others to spend their time helping you. I can't imagine too many experts being inspired to help you.
Dec 3 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: www | last post by:
Hi there, I need to calculate working days for a given period, "Date from", "Date To". Plus I want to be able to insert Public Holidays to exclude aswell. Your help will be greatly appreciated....
5
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
0
by: kumarkanth | last post by:
My question is how do I manipulate the procedure to calculate cut-off date with in working days and it should skip weekends and holidays? I have holiday table to determine holidays Table Name :...
4
by: shilpareddy2787 | last post by:
Hello, I have some total values, I want to calculate percenatge of these Total Values. I want to divide the total with No. Of working Days Excluding Saturdays and Sundays in a given period. ...
1
by: popovaa | last post by:
Hi: i need to get data for a time frame in a current year and same time frame in previous year. i found the below on this site which is almost what i need but i also need help on how to adjust the...
3
Jerry Maiapu
by: Jerry Maiapu | last post by:
Hi Scott Prince, Since this dean is not interested I need to do the same as Dean is trying to do. Since Dean has not replied would you mind to show me how to do this: You'll have to open this into...
2
by: Organised Angel | last post by:
Hi everyone I'm doing a project at work and I'm managing most of it fine apart from one section where I need to calculate a due date. The due date is 5 working days after the date entered. I...
1
by: Fahhad | last post by:
I have created a database with two fields "EmpID" (int) and "LeaveDate (DateTime) using SQL Server 2005. How Do I modify the below Stored Procedure to find the total working days for an employee...
11
by: mhschof | last post by:
I have an assigned SHIP DATE. I need to calculate an expected DUE date which is 9 working days prior to the ship date, and a START DATE which is 16 working days prior to the SHIP DATE. Working days...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.