Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to count working days?

Re: How to count working days?

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Wed, 8 Aug 2001 08:22:40 +0200
Message-ID: <9kqlrh$q1$1@s1.read.news.oleane.net>

"Grzesiek" <grzesiek_at_altavista.net> a écrit dans le message news: 9kp23c$sog$1_at_news.tpi.pl...
> Hi!
> Sorry for such easy question but I've spent preety much time on that before
> asking for help .
>
> I've got DATE_1 in TABLE_1 and DATE_2 in TABLE_2.
> I've got table CALENDAR with 2 columns: DATE, WORKING_DAY [Y/N]
> All I need is a sql report with
> DATE_1, DATE_2 and WORKING_DAYS between these two dates.
>
> Thanks in advance,
> Grzesiek
>

You can do something like:

select a.date_1, b.date_2, sum(decode(c.working_day,'Y',1,0)) from calendar c,

     (select date_2 from table_2) b,
     (select date_1 from table_1) a

where c.date between a.date_1 and b.date_2 group by a.date_1, b.date_2
/
--
Have a nice day
Michel
Received on Wed Aug 08 2001 - 01:22:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US