|
|
|
|
|
|
|
|
| Re: need help time schedule today 7am to next 7am for july [message #515671 is a reply to message #515639] |
Tue, 12 July 2011 20:03   |
 |
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
SQL> @calendar
SQL> def date_start = '01/07/2010'
SQL> def date_end = '31/07/2010'
SQL> with
2 data as (
3 select to_date('&date_start', 'DD/MM/YYYY') date1,
4 to_date('&date_end', 'DD/MM/YYYY') date2
5 from dual
6 )
7 select to_char(date1+level-1, 'DD/MM/YYYY') the_date
8 from data
9 connect by level <= date2-date1+1
10 /
old 3: select to_date('&date_start', 'DD/MM/YYYY') date1,
new 3: select to_date('01/07/2010', 'DD/MM/YYYY') date1,
old 4: to_date('&date_end', 'DD/MM/YYYY') date2
new 4: to_date('31/07/2010', 'DD/MM/YYYY') date2
THE_DATE
----------
01/07/2010
02/07/2010
03/07/2010
04/07/2010
05/07/2010
06/07/2010
07/07/2010
08/07/2010
09/07/2010
10/07/2010
11/07/2010
THE_DATE
----------
12/07/2010
13/07/2010
14/07/2010
15/07/2010
16/07/2010
17/07/2010
18/07/2010
19/07/2010
20/07/2010
21/07/2010
22/07/2010
THE_DATE
----------
23/07/2010
24/07/2010
25/07/2010
26/07/2010
27/07/2010
28/07/2010
29/07/2010
30/07/2010
31/07/2010
31 rows selected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|