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

Re: date series

From: Marc Billiet <first.last_at_com.hydro.switch.this>
Date: Wed, 02 May 2001 12:15:10 GMT
Message-ID: <20010502.12151090@y1032960.hae.hydro.com>

Hi,

First look for a table which constantly contains a lot of rows. In my

example, I have taken user tab columns.
Then execute following query:

select :date1 + rownum - 1
from user tab columns
where rownum <= (:date2 - :date1) + 1

'date1' contains the start date (01-05-2001), and 'date2' contains the

end date (07-05-2001).

Or hardcoded:

select to date('01-05-2001','DD-MM-YYYY') + (rownum-1) from user tab columns
where rownum <= to date('07-05-2001','DD-MM-YYYY')-to date('01-05-2001 ',
'DD-MM-YYYY') + 1 Marc

>>>>>>>>>>>>>>>>>> Oorspronkelijk bericht <<<<<<<<<<<<<<<<<<

Op 2001-05-02, 12:47:59, schreef "Jean" <ken jean_at_hotmail.com> over het

thema date series:

> Hi to all.
> I'm developing a web application based on Oracle 8.i database
> I need a query that outputs date series betweet two dates.
> For example I have start date 01-05-2001 (DD-MM-YYYY) and end date
> 07-05-2001 (DD-MM-YYYY) and the query results must be
> 01-05-2001
> 02-05-2001
> 03-05-2001
> 04-05-2001
> 05-05-2001
> 06-05-2001
> 07-05-2001
> I say that it can be possible using calendar functions but I'm not abl
e
to
> use it.
> Can anyone help me?
> All solutions is appreciated.
> Thank a lot in advance.
> Bye
 

> JEAN
Received on Wed May 02 2001 - 07:15:10 CDT

Original text of this message

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