I have a sequence of dates. I want to consider these dates as a group if the difference between them is less than 20 days (The condition).
For example the sequence of below dates can be divided in to two groups :
9/13/2013 9/20/2013 9/27/2013 10/4/2013 11/24/2013 12/1/2013 12/8/2013 12/15/2013 12/22/2013 12/29/2013
1-From 9/13/2013 to 10/4/2013 (The difference between dates is less than 20 days.)
The difference between 10/4/2013 and 11/24/2013 is more than 20 days. As consequence, the second group starts from 11/24/2013
2-From 11/24/2013 to 12/29/2013 (The difference between dates is less than 20 days).
I want to add a column to this table to show these sequence:
9/13/2013 1-Initial 9/20/2013 2 9/27/2013 3 10/4/2013 4-End 11/24/2013 1-Initial 12/1/2013 2 12/8/2013 3 12/15/2013 4 12/22/2013 5 12/29/2013 6-End
How can i do that? Thanks