Results 1 to 2 of 2

Thread: Database

  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Database

    Is there any ways to datediff the time difference between each row using sql? In the example, I would like to get the difference between row 1 and 2, row 2 and 3, etc. I am thinking I am pretty much stuck doing this in excel. All the dates and times in this table are in the same column.

    Any ideas would really be appreciated

    Datebase Name : KPITIMING
    KPIDatetime KPIAction
    2010-02-05 03:00:00 1
    2010-03-05 00:00:00 2

    Database Name : KPIACTION

    id Description
    1 SKI invoke NERS
    2 NERS invoke Biometric

    1.They is a relationship betwen KPITIMING and KPIAction,the relationship is the ID
    2.If the KPIACTION IN THE KPITIMING Database is 1 and 2 then it should check the DATEDIFF,between the 2010-02-05 03:00:00 and 2010-03-05 00:00:00 .

    Please help me.Really Stuck

    email addressremila.devi@nexbis.com


    2.The

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    If you are using Oracle you can use LEAD or LAG statement to compare two immediate rows.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •