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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help - "Business Day" Problem

Re: Help - "Business Day" Problem

From: sybrandb <sybrandb_at_gmail.com>
Date: 27 Apr 2007 06:04:42 -0700
Message-ID: <1177679082.501489.312440@o40g2000prh.googlegroups.com>


On Apr 27, 2:58 pm, "pankaj_wolfhun..._at_yahoo.co.in" <pankaj_wolfhun..._at_yahoo.co.in> wrote:
> Greetings,
> I have a requirement where an input date will be provided and I
> have to
> update a table with the date previous to input_date (input_date - 1)
>
> All I have to make sure is input_date - 1 should not be 'SAT' or 'SUN'
> and should not be
> in our holiday table.
>
> Something like
>
> UPDATE TABLE1
> SET final_date =(SELECT input_date - 1
> FROM ...
> WHERE TO_CHAR(TO_DATE ('input_date') - 1,'DY') NOT IN
> ('SAT','SUN')
> AND NOT EXISTS (SELECT h_holiday from holiday where h_holiday =
> input_date)
>
> My question do we need the FROM clause in the subquery? If yes, what
> to specify as this is just an
> input date and not from any table.
>
> Any help would be appreciated.
>
> TIA

  1. Yes
  2. this is what DUAL was invented for (OK: Originally it was used to send printer specific codes to output as the PROMPT command in sql*plus didn't yet exist)
--
Sybrand Bakker
Senior Oracle DBA
Received on Fri Apr 27 2007 - 08:04:42 CDT

Original text of this message

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