If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to get the timestamp differnce in microseconds

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-26-11, 07:01
prashant.gadekar prashant.gadekar is offline
Registered User
 
Join Date: Mar 2011
Posts: 8
How to get the timestamp differnce in microseconds

Hi,

I have to find the difference of timestamp values in microseconds.
Is there any function available that does this job ?

I have search for same, but got no luck.
Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 09-26-11, 07:17
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 09-26-11, 07:27
prashant.gadekar prashant.gadekar is offline
Registered User
 
Join Date: Mar 2011
Posts: 8
Allready checked this link

Hi,

Thanks for the reply.
I have allready checked the link. But there is nothing mentioned for microseconds there. It has shown function for getting difference in seconds.

But I am not able to deduce function for finding the difference in microseconds.

Can you help me?
Reply With Quote
  #4 (permalink)  
Old 09-26-11, 08:08
dbzTHEdinosaur dbzTHEdinosaur is offline
Registered User
 
Join Date: Jun 2007
Location: germany
Posts: 96
use 1 for the first arguement to the function TIMESTAMPDIFF which means microseconds.

but, would also suggenst looking in the appropriate version of the sql reference for guidance.

micorsecond results in microseconds + seconds + minutes (each of which is converted to microseconds.

probably be better off, removing the hours and minutes portion which calculating invoking the function for microseconds.
assuming that it is ALWAYS the same day,
you would have one SQL, with several SETS, one for function 1, one for 2, one for 4 and one for 8,
removing from each the micro/sec/min/hours.
if you are confused, read the manual and try a few selects.
__________________
Dick Brenholtz, Ami in Deutschland

Last edited by dbzTHEdinosaur; 09-26-11 at 09:13. Reason: spelling errors corrected.
Reply With Quote
  #5 (permalink)  
Old 09-26-11, 10:11
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Examples of microseconds difference are in here. (Not only milliseconds diff.)
Number of miliseconds between now and ...
Number of milliseconds between two timestamps - IBM DB2
Reply With Quote
Reply

Tags
db2, timestamp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On