I have stacked user actions in a table and would like to calculate the number of seconds between each action for each user within that day. The issue is multiple users can access at once, so their actions are stacked, and I would like to only calculate that difference if the actions occurred on the same day. example: data have: id Timestamp User date 1390267 2/19/2018 20:01:33 Rick 2/19/2018 1390273 2/19/2018 20:02:36 Mike 2/19/2018 1390276 2/19/2018 20:03:15 Rick 2/19/2018 1390763 2/19/2018 22:33:49 Fred 2/19/2018 1390979 2/19/2018 22:54:18 Suzi 2/19/2018 1391119 2/19/2018 23:12:39 Fred 2/19/2018 1391124 2/19/2018 23:13:21 Fred 2/19/2018 1392279 2/20/2018 22:54:00 Suzi 2/20/2018 1391339 2/20/2018 23:12:00 Fred 2/20/2018 data want: id Timestamp User date Dif 1390267 2/19/2018 20:01:33 Rick 2/19/2018 0 1390273 2/19/2018 20:02:36 Mike 2/19/2018 0 1390276 2/19/2018 20:03:15 Rick 2/19/2018 87 1390763 2/19/2018 22:33:49 Fred 2/19/2018 0 1390979 2/19/2018 22:54:18 Suzi 2/19/2018 0 1391119 2/19/2018 23:12:39 Fred 2/19/2018 2171 1391124 2/19/2018 23:13:21 Fred 2/19/2018 42 1392279 2/20/2018 22:54:00 Suzi 2/20/2018 0 1391339 2/20/2018 23:12:00 Fred 2/20/2018 0
... View more