AllExperts > Experts 
Search      

Database Programming

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Database Programming Answers
Question Library

Ask a question about Database Programming
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Marty Landman
Expertise
Database installation, analysis & design and programming questions.

Experience
Have done application programming as well as some installation and administration mostly with MySQL for web servers and site development and also with IMS and DB2 on legacy systems in the past.

Education/Credentials
MS in computer science.

 
   

You are here:  Experts > Industry > Data Management > Database Programming > Calculating a business day

Topic: Database Programming



Expert: Marty Landman
Date: 4/18/2008
Subject: Calculating a business day

Question
Dear Marty,

Do you know a simple method of taking a date and calculting 5 business days from that date?  For example, if I had a date of 4/8/08, the fifth day would be 4/14/08 when including the 8th.  I was hoping for something easy that may be calculated in a query.
Thank you - Jill

Answer
Jill,

You didn't say which database you're using. Mysql, like the other databases has extensive date functions available.

http://dev.mysql.com/doc/refman/5.0/en/date-calculations.html

However you will still have to do some legwork, for instance you can query to find dates and get the dayofweek for those dates. Then you would have to eliminate the weekend days, and probably holidays as well. Holidays of course vary depending on which country you are in.

Hope this is helpful.

--
Marty Landman, Face 2 Interface Inc.
Drupal Development Blog: http://drupal.face2interface.com/
Free Database Search App: http://face2interface.com/Products/FormATable.shtml

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.