MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 13th, 2012, 12:00 PM
markjs markjs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 markjs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 44 sec
Reputation Power: 0
Help with Create Espiodes query from Multiple overlapping dates

Hi

My first post and im looking for some help creating a query to take the data below and merge it into episodes of time where there is less than a 21 day gap in time.

What I want to show is that there is two episodes of time covered in the full data which should be the two below

2005-04-01 00:00:00.000 - 2010-11-12 00:00:00.000
2011-02-14 00:00:00.000 - 2012-05-06 00:00:00.000


Full data below

TEST1 2005-04-01 00:00:00.000 2005-04-28 00:00:00.000
TEST1 2005-04-01 00:00:00.000 2005-04-28 00:00:00.000
TEST1 2005-04-29 00:00:00.000 2005-05-19 00:00:00.000
TEST1 2005-04-29 00:00:00.000 2005-05-19 00:00:00.000
TEST1 2005-04-29 00:00:00.000 2005-05-19 00:00:00.000
TEST1 2005-04-29 00:00:00.000 2005-05-19 00:00:00.000
TEST1 2005-05-20 00:00:00.000 2005-06-23 00:00:00.000
TEST1 2005-05-20 00:00:00.000 2005-06-23 00:00:00.000
TEST1 2005-07-12 00:00:00.000 2006-03-31 00:00:00.000
TEST1 2005-07-12 00:00:00.000 2006-01-04 00:00:00.000
TEST1 2005-07-12 00:00:00.000 2006-01-04 00:00:00.000
TEST1 2005-07-12 00:00:00.000 2006-03-31 00:00:00.000
TEST1 2006-04-01 00:00:00.000 2007-01-31 00:00:00.000
TEST1 2006-04-01 00:00:00.000 2007-01-31 00:00:00.000
TEST1 2007-02-01 00:00:00.000 2007-03-31 00:00:00.000
TEST1 2007-02-01 00:00:00.000 2007-03-31 00:00:00.000
TEST1 2007-04-01 00:00:00.000 2008-01-31 00:00:00.000
TEST1 2007-04-01 00:00:00.000 2008-01-31 00:00:00.000
TEST1 2008-02-01 00:00:00.000 2008-03-31 00:00:00.000
TEST1 2008-02-01 00:00:00.000 2008-03-31 00:00:00.000
TEST1 2008-04-01 00:00:00.000 2009-03-31 00:00:00.000
TEST1 2008-04-01 00:00:00.000 2009-03-31 00:00:00.000
TEST1 2008-10-13 00:00:00.000 2008-11-02 00:00:00.000
TEST1 2008-10-13 00:00:00.000 2008-11-02 00:00:00.000
TEST1 2008-10-16 00:00:00.000 2008-10-31 00:00:00.000
TEST1 2008-10-16 00:00:00.000 2008-10-31 00:00:00.000
TEST1 2008-12-22 00:00:00.000 2009-03-31 00:00:00.000
TEST1 2008-12-22 00:00:00.000 2009-03-31 00:00:00.000
TEST1 2009-04-01 00:00:00.000 2010-03-31 00:00:00.000
TEST1 2009-04-01 00:00:00.000 2010-03-31 00:00:00.000
TEST1 2010-04-01 00:00:00.000 2010-11-12 00:00:00.000
TEST1 2010-04-01 00:00:00.000 2010-11-12 00:00:00.000
TEST1 2011-02-14 00:00:00.000 2011-02-23 00:00:00.000
TEST1 2011-03-11 00:00:00.000 2011-04-20 00:00:00.000
TEST1 2011-05-05 00:00:00.000 2011-05-16 00:00:00.000
TEST1 2011-05-17 00:00:00.000 2011-07-17 00:00:00.000
TEST1 2011-07-18 00:00:00.000 2011-10-12 00:00:00.000
TEST1 2011-10-13 00:00:00.000 2012-03-22 00:00:00.000
TEST1 2012-04-28 00:00:00.000 2012-05-06 00:00:00.000

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Help with Create Espiodes query from Multiple overlapping dates

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap