MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

timestamp - 1 minute

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
blitz2
Beginner


Joined: 23 Jan 2007
Posts: 84
Topics: 14

PostPosted: Tue Feb 06, 2007 10:20 am    Post subject: timestamp - 1 minute Reply with quote

Code:
SELECT * FROM TABLE WHERE TSP <= :WS-TSP AND TSP >= :WS-TSP - 1 MINUTES;


during execution, does the subtraction of 1 minute calculate to the exact millisecond? .. Or are the seconds and milliseconds part (from WS-TSP) ignored?!?

Further, what happens if it were 1 SECONDS instead of a minute?
_________________
If our constitution allows us free speech, why are there phone bills?
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Feb 06, 2007 11:26 am    Post subject: Reply with quote

blitz2, isn't 1 minute equal to 0 years, 0 months, 0 days, 0 hours, 1 min, 0 sec, 0 mil? If it where 1 seconds, there would be 0 years, etc... I think DB2 would generate the required literal so that the timestamp reduction (- 1 min) could be done and use a somewhat general compare routine for timestamps, all 26 characters; I believe nothing is ignored

the proof of 'exactness of the millisecond' is borne by the timestamps contained in the table. all you are doing with your SQL is accessing rows within a range of timestamps - something that DB2 does do with exactness.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Feb 06, 2007 1:40 pm    Post subject: Reply with quote

blitz2,

Check this link which explains about timestamp arthimetic

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/2.20.9.3?SHELF=&DT=20010718164132&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group