Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

How to extract overlapping date ranges from a table of date ranges

$
0
0
Would appreciate help and or hints to the following scenario::Magazine subscriptions are registered on a per subscriber basis with subscription id, subscriber id, start date, and end date.A subscriber can have N number of subscriptions. A subscription has a unique id, a start date, and an end date.Subscriptions for a subscriber could be like in the image below where each line describes a unique subscription with a start date and an end date.How to handle overlaps on a per subscriber basis so that the result set described in the image below can be delivered?Thank you in advance.[img]http://benning.dk/myimages/subscription-problem.png[/img]

Viewing all articles
Browse latest Browse all 3145

Trending Articles