Not sure I have understood correctly, but if you want to get the time difference between the ID and the preceding row ID you could load the data ordering it by ID then read the data back from the resident table and use 'peek' to retrieve TICKET_DATE of the row before, then use the returned value and the value of the current row to calculate the difference.