I was hoping someone could help me, Im trying to find the difference between two table values where other table values meet certain criteria.

I have a table containing the following fields

Call reference
Update Reference (an incremental number starting at 0 for each update on a call reference, when a new call reference is listed, this number reverts back to 0)
logtime (in epoch time)
updatetime (in epoch time)
closetime (in epoch time)

I need a query that will calculate the epoch time difference between each incremental update on each call.

The first value of the calculation should always be 0, the next one should be the difference between logtime and updatetime where update reference equals 1
The third value should be the difference between update time for updates 2 and 1, this should then loop until max of update reference.

I have uploaded an export of the table into excel if anyone would be able to help?