View previous topic :: View next topic |
Author |
Message |
rsamb Beginner
Joined: 09 Dec 2004 Posts: 1 Topics: 1
|
Posted: Wed Dec 15, 2004 1:59 am Post subject: check the difference between timestamps is > 5 minutes |
|
|
There are two timestamps of which one is current timestamp and other is existing one. We have to check whether the difference between the two timestamps is greater than 5 minutes.. (Consider all the fields)
How do we find that? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Dec 15, 2004 8:58 am Post subject: |
|
|
rsamb & vj2081,
hmm exact same question with same wording , but 2 different people . Please search before posting. The topic of getting the difference between 2 timestamps is already discussed. The following topic discusses about getting the difference in seconds. all you need is to convert the result into minutes which is quite easy.
Check the solution of the question (g) in the following topic
http://www.mvsforums.com/helpboards/viewtopic.php?t=2261
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Wed Dec 15, 2004 10:01 am Post subject: |
|
|
Hi,
This can be checked with the following SPUFI.
Code: | SELECT *
FROM TBL_NAME
WHERE ( CURRENT TIMESTAMP - EXISTING_TMSTMP ) > 300.000000 ; |
The difference between two time stamps will be always in the format "seconds.milliseconds". |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Dec 15, 2004 10:08 am Post subject: |
|
|
Quote: |
The difference between two time stamps will be always in the format "seconds.milliseconds".
|
Psridhar,
I beg to differ ! Can you show me the link which specifies that ? The result of subtracting one timestamp (TS2) from another (TS1) is a timestamp duration that specifies the number of years, months, days, hours, minutes, seconds, and microseconds between the two timestamps. The data type of the result is DECIMAL(20,6).
Check this link for a detailed explanation of Timestamp arithmetic
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/2.20.9.3?SHELF=&DT=20010718164132&CASE=
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|