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: date retrieval

Re: date retrieval

From: <frank_at_webtecsinc.com>
Date: 19 Oct 2006 10:30:57 -0700
Message-ID: <1161279056.997745.297830@k70g2000cwa.googlegroups.com>


No clue how it works, but that's what I needed. Thank you!

Maxim Demenko wrote:
> frank_at_webtecsinc.com schrieb:
> > Thank you for the reply. However, that just returns 5, for Thursday.
> >
> > DA Morgan wrote:
> >> frank_at_webtecsinc.com wrote:
> >>> How would I go about retrieving all Friday and Saturday dates between
> >>> two dates, say 5/1/06 and 11/1/06?
> >> By using TO_CHAR in the following fashion:
> >>
> >> SELECT TO_CHAR(SYSDATE, 'D') FROM dual;
> >>
> >> and filter for the values 6 or 7.
> >> --
> >> Daniel A. Morgan
> >> University of Washington
> >> damorgan_at_x.washington.edu
> >> (replace x with u to respond)
> >> Puget Sound Oracle Users Group
> >> www.psoug.org
> >

>

> SQL> SELECT days , to_char(days,'Day') days_w FROM (
> 2 SELECT DATE '2006-01-05' -1 + ROWNUM days
> 3 FROM dual
> 4 CONNECT BY LEVEL <= DATE '2006-01-11' - DATE '2006-01-05' +1)
> 5 WHERE to_char(days,'D') IN ('6','7')
> 6 /
>

> DAYS DAYS_W
> ------------------ ------------------------------------
> 06-JAN-06 Friday
> 07-JAN-06 Saturday
>
> Best regards
>
> Maxim
Received on Thu Oct 19 2006 - 12:30:57 CDT

Original text of this message

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