Solved

SQL - Add days to working date

Posted on 2013-06-24
2
593 Views
Last Modified: 2013-06-25
I'm looking at trying to add working days to a date in sql.  Since our date never are in a weekend, I would like to add 4 days to a working date, but do not want it to fall within a weekend.

How would I write the query to do this?

Example:
Date = 5/1/2013
Working Day = 4

Output: 5/7/2013
0
Comment
Question by:holemania
2 Comments
 
LVL 22

Accepted Solution

by:
Steve Wales earned 500 total points
ID: 39273143
Was going to put together a query but did a google search first and found this:

http://stackoverflow.com/questions/5471524/add-business-days-to-date-in-sql-without-loops

Several different variations presented there.  Give them a try.
0
 

Author Closing Comment

by:holemania
ID: 39275211
Thanks.  I saw that as well when searching for it, but couldn't get the last one to work.  Just played with everyone of them until I got one to work.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now