Re: Count days without week-end
Posted in 2000
From: philippe juillot <philippe.juillot@siemens.at>
>
>Content-Type: text/plain; charset=us-ascii
1. Please don't post MIME.
>We want to count the days between 2 dates in 2 ways:
>
> * all the days:
> select '2000.09.26' - '2000.09.22' + 1 from systables where tabid =
> 1;
> Result ist 5 days ... no problem!
>
> * the days without the week-end:
> Result must be 3 (Friday, Monday, Tuesday)
> How can I do this? The interval between the 2 dates can be more
> than 1 year.
All I can come up with is that you create a table of date records and
SELECT COUNT(*)
FROM datetable
WHERE ddate BETWEEN x AND y
AND WEEKDAY(ddate) BETWEEN 1 and 5
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.