Here's a link to a solution that Oracle came up with: http://dco-proxima.dco.pima.edu/oracle/tfts/PRE00136.HTM

You should be able to adapt it to MySQL and PHP (or whatever language you are using).
Basically, the script gets the start date and end date, then steps through every day counting only business week days.


Of course, and another question to consider, is if you wish to count holidays or not.

jeff

At 12:58 -0500 2/24/03, Lucas Cowgar wrote:
Can anyone out there help me with a SQL query? I need to find the number of
business days between date a and b? Obviously finding simply the number of
days is easy, but I have no clue how to find the number of business days.
TIA!


Lucas Cowgar Information Technologies Department Eldorado Services Group Inc. http://www.eldoserv.com [EMAIL PROTECTED] (330) 861-3009

"All your base are belong to us"

-- _ __ __ +----------------------------------+ / | / /__ ____ _____/ /_ ____ _|Jeff Shapiro | / |/ / _ \/ __ \/ ___/ __ \/ __ `/|Photography and Graphic Design | / /| / __/ / / (__ ) / / / /_/ / |Colorado Springs, CO, USA | /_/ |_/\___/_/ /_/____/_/ /_/\__,_/ |www.nensha.com ||| [EMAIL PROTECTED]| +----------------------------------+

---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to