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

Home -> Community -> Usenet -> c.d.o.server -> Re: Working days

Re: Working days

From: Monty <mmontreaux_at_hotmail.com>
Date: 12 Apr 2003 01:57:31 -0700
Message-ID: <6284dd3.0304120057.1bf0a358@posting.google.com>


Oops - yes running 8i.
Monty

Kenneth Koenraadt wrote in message news:<3e95b158.6044681_at_news.inet.tele.dk>...
> On 10 Apr 2003 09:56:13 -0700, mmontreaux_at_hotmail.com (Monty) wrote:
>
> >Hi, can someone help me with a SQL query to calculate the date which
> >is todays date+3 non-weekend days, ie monday 01 jan+3=thursday 04 jan,
> >tuesday 02 jan+3=friday 05 jan, wednesday 03 jan+3=monday 08 jan,
> >thursday 04 jan+3=tuesday 09 jan, friday 05 jan+3=wednesday 10 jan,
> >saturday 06+3=wednesday 10 jan, sunday+3=wednesday 10 jan.
> >
> >Thank you
> >Monty
>
> Hi Monty,
>
> This is one of about a dozen ways to do it :
>
>
> select sysdate + (case when to_char(sysdate,'D') in ('1','2','7')
> then 3 when to_char(sysdate,'D') in ('3','4','5') then 5 else 4 end )
> from dual;
>
> If you are running 9i, you may also consider the EXTRACT date
> function.
>
>
> - Kenneth Koenraadt
Received on Sat Apr 12 2003 - 03:57:31 CDT

Original text of this message

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