Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL - Add days to working date

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SELECT query on two levels (detail and summary) 13 57
SSRS 2013 - Creating a summarized report 19 47
Format Data Field - SQL 11 37
Syntax Issue with SSIS module 26 101
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…
As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 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