How to calculate time difference between datetimes, for each group (student-contract)?
I have a specific problem; I have data in the following format: # USER_ID SUBMISSION_DATE CONTRACT_REF 1 1 20/6 1:00 W001 2 1 20/6 2:00 W002 3 1 20/6 3:30 W003 4 4 20/6 4:00 W004 5 5 20/6 5:00 W005 6 5 20/6 6:00 W006 7 7 20/6 7:00 W007 8 7 20/6 8:00 W008 9 7 20/6 9:00 W009 10 7 20/6 10:00 W0010 Now I need to somehow calculate the time difference between the different submissions (uniquely identifiable). In other words: I have a table of submissions , in this table, there are all submissions for all users. I need to find a way how to calculate the time difference for each unique STUDENT