SQL Server Performance

Time difference

Discussion in 'ALL SQL SERVER QUESTIONS' started by chs, Dec 30, 2011.

  1. chs New Member

    Sample data

    User Action DateTime
    Smith inserted 22/7/2010 8:33
    Andy inserted 22/7/2010 9:40
    Steve collected 22/7/2010 10:01
    Smith Update 22/7/2010 10:05
    Scott inserted 22/7/2010 10:10
    Paul inserted 22/7/2010 10:30
    Smith collected 22/7/2010 10:45
    Smith collected 22/7/2010 10:50
    Smith deleted 22/7/2010 11:15
    Smith inserted 22/7/2010 12:15

    Desired output

    User Action Time TimeDifference

    Smith Inserted 22/7/2010 8:33

    Smith deleted 22/7/2010 11:15

    I need to find the time difference between Inserted(first) and deleted(before next inserted)

Share This Page