m***@hotmail.com
2018-11-29 13:47:53 UTC
I have a large data set. 100,000+ cases.
I want the oldest and newest cases per day by tempID.
In the data set, each day I may have 20 cases with the same ID and I only want to keep the oldest case and the newest case per day.
How do I write the syntax?
Example:
ID DATE TIME
39 21-Aug-2016 9:59:01.00
39 21-Aug-2016 9:59:05.00
39 23-Oct-2016 9:58:08.00
39 23-Oct-2016 9:58:34.00
39 23-Oct-2016 9:59:34.00
39 23-Oct-2016 10:00:04.100
39 23-Oct-2016 10:00:35.00
39 23-Oct-2016 10:01:05.00
39 19-Nov-2016 7:19:40.100
39 19-Nov-2016 7:20:12.00
39 19-Nov-2016 7:20:42.00
39 19-Nov-2016 7:21:36.00
39 19-Nov-2016 7:29:17.00
39 19-Nov-2016 7:29:49.00
39 19-Nov-2016 7:30:17.100
39 19-Nov-2016 7:32:47.00
39 19-Nov-2016 7:33:47.00
39 19-Nov-2016 7:34:42.100
Help would be greatly appreciated.
I want the oldest and newest cases per day by tempID.
In the data set, each day I may have 20 cases with the same ID and I only want to keep the oldest case and the newest case per day.
How do I write the syntax?
Example:
ID DATE TIME
39 21-Aug-2016 9:59:01.00
39 21-Aug-2016 9:59:05.00
39 23-Oct-2016 9:58:08.00
39 23-Oct-2016 9:58:34.00
39 23-Oct-2016 9:59:34.00
39 23-Oct-2016 10:00:04.100
39 23-Oct-2016 10:00:35.00
39 23-Oct-2016 10:01:05.00
39 19-Nov-2016 7:19:40.100
39 19-Nov-2016 7:20:12.00
39 19-Nov-2016 7:20:42.00
39 19-Nov-2016 7:21:36.00
39 19-Nov-2016 7:29:17.00
39 19-Nov-2016 7:29:49.00
39 19-Nov-2016 7:30:17.100
39 19-Nov-2016 7:32:47.00
39 19-Nov-2016 7:33:47.00
39 19-Nov-2016 7:34:42.100
Help would be greatly appreciated.