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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Week - Date function!

RE: Week - Date function!

From: Stephane Faroult <sfaroult_at_oriolecorp.com>
Date: Fri, 28 Mar 2003 06:38:46 -0800
Message-ID: <F001.005752BA.20030328063846@fatcity.com>


SQL> l
  1 select x.d
  2 from (select to_date(rownum, 'DDD') d,

  3               to_number(to_char(to_date(rownum, 'DDD'), 'IW')) week
  4        from all_objects
  5        where rownum < 366) x

  6* where x.week = &week_num

You may have a problem with leap years, but it's basically the idea. Anything smarter, somebody ?

>
>Given a week between (1 - 52) for a particular year
>can we get all the dates within that week. Is there
>a function to do this
>in SQL???
>
>Thanks a lot.
>
>Regards
>Sesi
>--

Regards,

Stephane Faroult
Oriole

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephane Faroult
  INET: sfaroult_at_oriolecorp.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Mar 28 2003 - 08:38:46 CST

Original text of this message

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