I need to calculate the claimed time of IssueID by user Total claim time is time from status claim till recent waiting. Looks a bit complex Kindly help out.
IssueID TransTime User Status
101 2019-08-23 0:25:41 Peter CLAIMED
101 2019-08-23 0:25:44 Peter CLAIMED
101 2019-08-23 0:26:12 Peter WAITING
101 2019-08-23 20:14:13 Peter CLAIMED
101 2019-08-23 20:14:16 Peter CLAIMED
101 2019-08-23 20:14:52 Peter WAITING
102 2019-08-24 8:59:19 Miller CLAIMED
102 2019-08-24 8:59:56 Miller CLAIMED
102 2019-08-24 9:00:09 Miller WAITING
102 2019-08-24 9:00:17 Miller CLAIMED
102 2019-08-24 9:00:20 Miller CLAIMED
102 2019-08-25 21:56:52 Miller WAITING`
For example, For peter total claim time start from '2019-08-23 0:25:41' till the first waiting time '2019-08-23 0:26:12' and next from '2019-08-23 20:14:13' till '2019-08-23 20:14:52'. All this time difference add up to the total time claimed by peter, which is around 31 seconds first and 39 seconds in the second time. Comes around 70 seconds.
Thanks in Advance
`