Home » SQL & PL/SQL » SQL & PL/SQL » need help time schedule today 7am to next 7am for july(5 Merged)
icon7.gif  need help time schedule today 7am to next 7am for july(5 Merged) [message #515639] Tue, 12 July 2011 10:31 Go to next message
thuya
Messages: 4
Registered: July 2011
Location: singapore
Junior Member
Hi everyone,

Im tring logic for --
today 7am to next 7am is one day.
eg: 13-july-2011 morning 7am to 14-july-2011 7am morning is one day
so that I want to show all the days belongs with that time schedule for july. I want logic query in pl/sql.

anybody can help me urgent!

Thanks
Re: time schedule for 7am to 7am logic [message #515640 is a reply to message #515639] Tue, 12 July 2011 10:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: time schedule for 7am to 7am logic [message #515641 is a reply to message #515640] Tue, 12 July 2011 10:37 Go to previous messageGo to next message
cookiemonster
Messages: 13975
Registered: September 2008
Location: Rainy Manchester
Senior Member
Surely all the days in july belong to that time schedule?
Re: time schedule for 7am to 7am logic [message #515646 is a reply to message #515639] Tue, 12 July 2011 11:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68775
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
date generator

Regards
Michel
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 Go to previous messageGo to next message
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.
icon7.gif  Re: need help time schedule today 7am to next 7am for july [message #515688 is a reply to message #515671] Tue, 12 July 2011 23:04 Go to previous messageGo to next message
thuya
Messages: 4
Registered: July 2011
Location: singapore
Junior Member
hi BlackSwan,

thanks but I want 7am to 7am show all the days for july in pl/sql Sad
Re: time schedule for 7am to 7am logic [message #515689 is a reply to message #515641] Tue, 12 July 2011 23:05 Go to previous messageGo to next message
thuya
Messages: 4
Registered: July 2011
Location: singapore
Junior Member
yes sure
Re: time schedule for 7am to 7am logic [message #515691 is a reply to message #515689] Tue, 12 July 2011 23:15 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>thanks but I want 7am to 7am show all the days for july in pl/sql

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: time schedule for 7am to 7am logic [message #515709 is a reply to message #515691] Wed, 13 July 2011 00:46 Go to previous messageGo to next message
thuya
Messages: 4
Registered: July 2011
Location: singapore
Junior Member
hi
There is no post
im trying like this way

case
when (to_char(sysdate, 'HH24MISS') > '070000') then


(to_char(sysdate+1)


else

(to_char(sysdate)

i want all of days for july

[Updated on: Wed, 13 July 2011 00:47]

Report message to a moderator

Re: need help time schedule today 7am to next 7am for july [message #515742 is a reply to message #515688] Wed, 13 July 2011 03:04 Go to previous message
cookiemonster
Messages: 13975
Registered: September 2008
Location: Rainy Manchester
Senior Member
thuya wrote on Wed, 13 July 2011 05:04
hi BlackSwan,

thanks but I want 7am to 7am show all the days for july in pl/sql Sad


We have no idea what you mean by that. I suggest you show us the expected output.
Previous Topic: how to get the reduplicate rows
Next Topic: SQL calculating stock using FIFO
Goto Forum:
  


Current Time: Wed Apr 01 00:19:58 CDT 2026