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

Home -> Community -> Usenet -> c.d.o.server -> Re: A tricky sql date question

Re: A tricky sql date question

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Tue, 21 Nov 2000 22:24:39 +0800
Message-ID: <3A1A85A7.5387@yahoo.com>

seanfour_at_my-deja.com wrote:
>
> Is there any way I can list the dates of all the days between 2 dates
> without looping through a select statement from dual? Basically I want
> to be able to give it, say '01-AUG-2001' and '01-AUG-2002' and have it
> spit back all of the dates between without having to hit the DB 365
> times to do it. Thanks for any help!!
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Use any table with at least that many rows...

select to_date('01-aug-2000','dd-mon-yyyy')+rownum from <any table>
where rownum < (for example) 60;

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk (mirrored at
http://www.oradba.freeserve.co.uk)

(Apologies for not replying to any emails - YAHOO have a dead server)

"Early to bed and early to rise, 
 makes a man healthy, wealthy and wise." - some dead guy
Received on Tue Nov 21 2000 - 08:24:39 CST

Original text of this message

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