SELECT
start_date,
end_date,
DATEDIFF(end_date, start_date) -
(WEEK(end_date) - WEEK(start_date)) * 2
AS business_days
FROM DateDiffs
ORDER BY start_date;
+---------------------+---------------------+---------------+
| start_date | end_date | business_days |
+---------------------+---------------------+---------------+
| 2005-01-04 16:44:57 | 2005-01-10 17:53:33 | 4 |
| 2005-01-17 00:00:00 | 2005-02-18 00:00:00 | 24 |
| 2005-01-21 00:00:00 | 2005-02-18 00:00:00 | 20 |
| 2005-01-24 00:00:00 | 2005-02-18 00:00:00 | 19 |
| 2005-01-28 00:00:00 | 2005-02-18 00:00:00 | 15 |
| 2005-01-31 00:00:00 | 2005-02-18 00:00:00 | 14 |
| 2005-02-04 00:00:00 | 2005-02-18 00:00:00 | 10 |
| 2005-02-07 00:00:00 | 2005-02-18 00:00:00 | 9 |
| 2005-02-14 00:00:00 | 2005-02-18 00:00:00 | 4 |
+---------------------+---------------------+---------------+
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]