I really wanted to solve this problem but there comes a point when you have to just put it out there, learn and move on.
I have a temporary table which contains 1 column, POCDates, which is a list of dates, some of which are continuous/contiguous. For example:
POCDates
01/01/2014
02/01/2014
03/01/2014
04/01/2014
10/03/2014
11/03/2014
25/03/2014
26/03/2014
28/03/2014
I am looking to run a query in my procedure that will select from this temporary table and, using the sample data above, display the following:
POCDatesSummary
Start End Count
01/01/2014 04/01/2014 4
10/03/2014 11/03/2014 2
25/03/2014 26/03/2014 2
28/03/2014 28/03/2014 1
The count isn't essential, but I suspect that this is the most simple part using a DATEDIFF so I've left it in there.
I have tried a number of approaches and trawled forums for similar problems; nothing has come close. Hope I can find the answer here.