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: All Dates

Re: All Dates

From: Mark D Powell <markp7832_at_my-deja.com>
Date: Wed, 27 Sep 2000 14:38:31 GMT
Message-ID: <8qt0p6$uof$1@nnrp1.deja.com>

In article <39D1EE2F.9706EB5D_at_bt.com>,
  trevor burkin <trevor.2.burkin_at_bt.com> wrote:
> Hope this helps
>
> select to_date('&1','ddmmyyyy') + rownum - 1
> from table_with_more_rows_than_dates_required
> where rownum <= to_date('&2','ddmmyyyy') - to_date('&1','ddmmyyyy') +
 1
>
> Regards Trevor
>
> Ganesh R wrote:
>
> > Hi,
> >
> > I want to fetch all the dates btw. to given dates. This can be
 achived
> > thru PL?SQL but i want to get it thru a Select Statement.
> >
> > Any Help
> >
> > Regards,
> > Ganesh R
> >

It looks like Trevor pulled his answer from code intended to solve a more complex problem. All you need is to use the between clause or a combination of >= and <.

where date_col between to_date('start','Format') and

                       to_date('End','Format')

Or

where date_col >= to_date('start','Format') and date_col < to_date('end','Format')

--
Mark D. Powell  -- The only advice that counts is the advice that
 you follow so follow your own advice --


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Sep 27 2000 - 09:38:31 CDT

Original text of this message

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