Select all the dates between date1 and date2 [message #6697] |
Fri, 02 May 2003 02:09 |
Marjorin Mendoza
Messages: 15 Registered: September 2002
|
Junior Member |
|
|
Hi. I would just like to ask if it is possible to return all the dates between date1 and date2 in oracle 8i?
e.g. Date1 = 11/25/2002 and Date2 = 12/04/2002
it would return
11/25/2002
11/26/2002
11/27/2002
...
12/03/2002
12/04/2002
total no. of records is 10.
|
|
|
Re: Select all the dates between date1 and date2 [message #6698 is a reply to message #6697] |
Fri, 02 May 2003 03:10 |
Deepa
Messages: 269 Registered: November 2000
|
Senior Member |
|
|
select to_date( '01-jan-2002', 'dd-mon-yyyy' ) + rownum -1 dt
from all_objects
where rownum <= last_day( to_date('01-dec-2002','dd-mon-yyyy') ) - to_date(
'01-jan-2002', 'dd-mon-yyyy' ) + 1;
This query will list all the days of the year 2002
u can formulate this according to ur requirement
|
|
|
|