Solved

SQL - Add days to working date

Posted on 2013-06-24
2
622 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

785 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