SQL Query can u help DATES Between 2 dates using table
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