I have a dataset that looks like the following;
ID Date
1 2018-07-23
1 2018-07-24
1 2018-07-25
1 2018-07-26
1 2019-12-31
2 2020-01-01
2 2020-01-02
2 2020-01-03
2 2020-01-06
2 2020-01-07
What I am trying to achieve is convert this dataset into start and end dates for wherever their are any gaps in the date column.
So the expected output would look like the following;
ID StartDate EndDate
1 23-07-2018 26-07-2018
1 31-12-2019 31-12-2019
2 01-01-2020 03-01-2020
2 06-01-2020 07-01-2020
As you can see, both IDs have two rows because there was a gap in the dates.
Please Help and thank you.