Re: # of Business Days?

2003-02-24 Thread Tore Bostrup
If you truly want only business days - i.e. you don't want to count Holidays - the only solution is to have a tables with all the business days. You'd populate this periodically with future dates as required, and a human may be required to mark off the holidays (unless you can create an algorithm t

Re: # of Business Days?

2003-02-24 Thread Bruce Lewis
oe Stump" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, February 24, 2003 2:21 PM Subject: Re: # of Business Days? > Hello > > This is not correct, see this at example: > From friday to mondey there are 4 days (or 3, depends on how you count ;-). > your calcs:

Re: # of Business Days?

2003-02-24 Thread Patrick Näf
Hello This is not correct, see this at example: From friday to mondey there are 4 days (or 3, depends on how you count ;-). your calcs: $day = 4 $weeks = 4 / 7 = 0 $weekend_day = 0 * 2 = 0 $business_days = 4 - 0 = 4 If you have 100 weeks, then it will be quite correct. here is my solution: $day

RE: # of Business Days?

2003-02-24 Thread Jeremy Tinley
use Date::Manip http://www.perldoc.com/perl5.6.1/lib/Date/Manip.html -J -Original Message- From: Andrew Braithwaite [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 1:33 PM To: 'Lucas Cowgar'; MySQL Mailing List Subject: RE: # of Business Days? >>Can anyone o

RE: # of Business Days?

2003-02-24 Thread Andrew Braithwaite
>>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! Here's some ropey perl I wrote a ages back to calculate workin

Re: # of Business Days?

2003-02-24 Thread Jeff Shapiro
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 b

RE: # of Business Days?

2003-02-24 Thread Joe Stump
I'm not sure of an exact query, but if you can get the total number of days you can mathmatically get the biz days with the following math (in psuedo code): $days = total_days_between_a_and_b; $weeks = ($days / 7); $weekend_days = $weeks * 2; $business_days = ($days - $weekend_days); Hope this he