I want to count consecutive days (rows) and that is fairly easy (given all the answers to similar questions). But in my data set I have groups of consecutive rows with dates such as:
1. 30/12/2010
2. 31/12/2010
3. 01/01/2011
4. 02/01/2011
Looks like a one group (4 consecutive days), but I would like to split this group into two groups. So when having:
1. 30/12/2010
2. 31/12/2010
3. 01/01/2011
4. 02/01/2011
5. 05/01/2011
6. 06/02/2011
7. 07/02/2011
I would like to see this grouped into four groups (not three):
1. 30/12/2010
2. 31/12/2010
3. 01/01/2011
4. 02/01/2011
5. 05/01/2011
6. 06/02/2011
7. 07/02/2011
I'm using SQL Server 2014