Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Query can u help DATES Between 2 dates using table

DELIVER BIMay 4 2007 — edited May 9 2007
Hi i have this query , But i wish to use a table to run it, But it has to be in sql

select distinct TRUNC(TO_DATE('JAN-2007','mm/yyyy')) + lvl "Date"
from (select level - 1 lvl
from dual connect by level <= LAST_DAY(TO_DATE('JAN-2007','mm/yyyy')) - TRUNC(TO_DATE('JAN-2007','mm/yyyy'))+ 1)


I want to use a table called gl_periods that contains a start_date, end_date, period_name,

Need to pass the start_date and end_date to the sql query get the dates in between the 2 dates, but i need a where clause so i can tell it which period to run,

so in where clause i would put 'JAN-2001' , in the table the start_date and end_date will be 01-jan-2001 and end_date will be 31-jan-2001.

Can anyone help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 6 2007
Added on May 4 2007
20 comments
3,570 views