IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

day and Time related query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chrakesh

New User


Joined: 03 May 2010
Posts: 16
Location: india

PostPosted: Wed May 12, 2010 12:56 pm
Reply with quote

Hi how can i find whether some specific date suppose dome Due_date is between the following Sunday 12 am and next week Saturday 11:59 pm .

can anyone suggest a sql query for this.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 12, 2010 2:11 pm
Reply with quote

Read this www.ibm.com/developerworks/data/library/techarticle/0211yip/0211yip3.html#icomments
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Wed May 12, 2010 9:51 pm
Reply with quote

or this www.ibm.com/developerworks/data/library/techarticle/0211yip/0211yip3.html
Back to top
View user's profile Send private message
chrakesh

New User


Joined: 03 May 2010
Posts: 16
Location: india

PostPosted: Tue May 25, 2010 1:46 pm
Reply with quote

Can anyone help me on this query, how can we write the specific query?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue May 25, 2010 2:43 pm
Reply with quote

You should be able to figure it out by yourself, by reading the stuff.

a date is not between timestamps,
a specific timestamp is between next sunday, 12am and following saturday,23:59 pm
a specific date is between next sunday and following saturday

Code:
select
current_date + (7 - dayofweek_iso(current_date)) days,
current_date + (13 - dayofweek_iso(current_date)) days,
timestamp(current_date + (7 - dayofweek_iso(current_date)) days,'00:00:00'),
timestamp(current_date + (13 - dayofweek_iso(current_date)) days,'23:59:59')+ 999999 microseconds
from sysibm.sysdummy1
Back to top
View user's profile Send private message
chrakesh

New User


Joined: 03 May 2010
Posts: 16
Location: india

PostPosted: Tue May 25, 2010 5:32 pm
Reply with quote

Thanks man....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top