Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Time difference between records

Re: Time difference between records

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 14 Sep 2004 20:15:37 -0700
Message-ID: <1095218205.757061@yasure>


Hans Forbrich wrote:

> Scott Johnson wrote:
> 
> 

>>I need to find a method (sql, plsql) to find the time difference between
>>records
>>
>>Example,
>>Ticket# Operation Time
>>A1 Modify 1000
>>A1 Modify 1100
>>A1 Modify 1300
>>A2 Modify 0900
>>A2 Modify 0930
>>
>>Should produce something like:
>>
>>A1 1 hour
>>A1 2 hours
>>A2 30 minutes
>>
>>Has anyone done this before?
> 
> 
> 1) Ain't going nowhere if you don't capture a 'modified date/time' stamp.
> 
> 2) Different database version provide different capabilities to help here.
> 
> 3) In 10g look up the time interval datatype, otherwise look up date
> arithmetic, both in the SQL Reference manual.

Interval data type available in 9i too.

There is a demo of its use at:
http://www.psoug.org
click on Timestamp
search for "Time Math"

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Tue Sep 14 2004 - 22:15:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US