Home » SQL & PL/SQL » SQL & PL/SQL » Select all the dates between date1 and date2
Select all the dates between date1 and date2 [message #6697] Fri, 02 May 2003 02:09 Go to next message
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 Go to previous messageGo to next message
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
Re: Select all the dates between date1 and date2 [message #6699 is a reply to message #6698] Fri, 02 May 2003 03:22 Go to previous message
Marjorin
Messages: 1
Registered: May 2003
Junior Member
ok thanks ...
Previous Topic: Replace New Line Character stored in block shape
Next Topic: Trigger related question
Goto Forum:
  


Current Time: Fri Apr 26 08:03:52 CDT 2024