Finding Gaps in Dates

  • Hello! I'm fairly stumped with a problem at the moment... I'm trying to find gaps in times in a table of sessions where the session endings aren't sequential. That is, session 1 can start at 10:00 and finish at 10:30, while session 2 started at 10:05 and finished at 10:45, and session 3 started at 10:06 and finished at 10:20. Only the starting times are in order; the ending times can be anywhere after that.

    Here's a bunch of sample data:

    CREATE TABLE #SessionTest(SessionId int,Logindatetime datetime, Logoutdatetime datetime)

    INSERT INTO #SessionTest

    SELECT '1073675','Mar 3 2014 1:53PM','Mar 3 2014 1:53PM' UNION ALL

    SELECT '1073676','Mar 3 2014 2:26PM','Mar 3 2014 3:51PM' UNION ALL

    SELECT '1073677','Mar 3 2014 2:29PM','Mar 3 2014 3:54PM' UNION ALL

    SELECT '1073678','Mar 3 2014 2:29PM','Mar 3 2014 5:47PM' UNION ALL

    SELECT '1073679','Mar 3 2014 2:30PM','Mar 3 2014 3:37PM' UNION ALL

    SELECT '1073680','Mar 3 2014 2:30PM','Mar 3 2014 2:33PM' UNION ALL

    SELECT '1073681','Mar 3 2014 2:31PM','Mar 3 2014 6:02PM' UNION ALL

    SELECT '1073682','Mar 3 2014 2:33PM','Mar 3 2014 4:02PM' UNION ALL

    SELECT '1073683','Mar 3 2014 2:34PM','Mar 3 2014 5:00PM' UNION ALL

    SELECT '1073684','Mar 3 2014 2:34PM','Mar 3 2014 5:06PM' UNION ALL

    SELECT '1073685','Mar 3 2014 2:34PM','Mar 3 2014 3:44PM' UNION ALL

    SELECT '1073686','Mar 3 2014 2:34PM','Mar 3 2014 2:44PM' UNION ALL

    SELECT '1073687','Mar 3 2014 2:36PM','Mar 3 2014 6:00PM' UNION ALL

    SELECT '1073688','Mar 3 2014 2:37PM','Mar 3 2014 3:40PM' UNION ALL

    SELECT '1073689','Mar 3 2014 2:37PM','Mar 3 2014 3:43PM' UNION ALL

    SELECT '1073690','Mar 3 2014 2:39PM','Mar 3 2014 4:42PM' UNION ALL

    SELECT '1073691','Mar 3 2014 2:39PM','Mar 3 2014 3:26PM' UNION ALL

    SELECT '1073692','Mar 3 2014 2:40PM','Mar 3 2014 3:35PM' UNION ALL

    SELECT '1073693','Mar 3 2014 2:41PM','Mar 3 2014 4:42PM' UNION ALL

    SELECT '1073694','Mar 3 2014 2:42PM','Mar 3 2014 3:40PM' UNION ALL

    SELECT '1073695','Mar 3 2014 2:43PM','Mar 3 2014 4:35PM' UNION ALL

    SELECT '1073696','Mar 3 2014 2:44PM','Mar 3 2014 5:32PM' UNION ALL

    SELECT '1073697','Mar 3 2014 2:44PM','Mar 3 2014 2:45PM' UNION ALL

    SELECT '1073698','Mar 3 2014 2:46PM','Mar 3 2014 2:46PM' UNION ALL

    SELECT '1073699','Mar 3 2014 2:46PM','Mar 3 2014 6:07PM' UNION ALL

    SELECT '1073700','Mar 3 2014 2:47PM','Mar 3 2014 5:37PM' UNION ALL

    SELECT '1073701','Mar 3 2014 2:47PM','Mar 3 2014 3:16PM' UNION ALL

    SELECT '1073702','Mar 3 2014 2:48PM','Mar 3 2014 5:35PM' UNION ALL

    SELECT '1073703','Mar 3 2014 2:49PM','Mar 3 2014 2:50PM' UNION ALL

    SELECT '1073704','Mar 3 2014 2:50PM','Mar 3 2014 5:32PM' UNION ALL

    SELECT '1073705','Mar 3 2014 2:50PM','Mar 3 2014 4:43PM' UNION ALL

    SELECT '1073706','Mar 3 2014 2:51PM','Mar 3 2014 4:30PM' UNION ALL

    SELECT '1073707','Mar 3 2014 2:52PM','Mar 3 2014 5:19PM' UNION ALL

    SELECT '1073708','Mar 3 2014 2:52PM','Mar 3 2014 6:02PM' UNION ALL

    SELECT '1073709','Mar 3 2014 2:55PM','Mar 3 2014 3:44PM' UNION ALL

    SELECT '1073710','Mar 3 2014 2:56PM','Mar 3 2014 5:32PM' UNION ALL

    SELECT '1073711','Mar 3 2014 2:56PM','Mar 3 2014 6:07PM' UNION ALL

    SELECT '1073712','Mar 3 2014 2:56PM','Mar 3 2014 7:44PM' UNION ALL

    SELECT '1073713','Mar 3 2014 2:58PM','Mar 3 2014 3:34PM' UNION ALL

    SELECT '1073714','Mar 3 2014 2:59PM','Mar 3 2014 7:07PM' UNION ALL

    SELECT '1073715','Mar 3 2014 2:59PM','Mar 3 2014 5:32PM' UNION ALL

    SELECT '1073716','Mar 3 2014 3:00PM','Mar 3 2014 5:57PM' UNION ALL

    SELECT '1073717','Mar 3 2014 3:00PM','Mar 3 2014 5:15PM' UNION ALL

    SELECT '1073718','Mar 3 2014 3:01PM','Mar 3 2014 3:40PM' UNION ALL

    SELECT '1073719','Mar 3 2014 3:03PM','Mar 3 2014 5:04PM' UNION ALL

    SELECT '1073720','Mar 3 2014 3:04PM','Mar 3 2014 6:03PM' UNION ALL

    SELECT '1073721','Mar 3 2014 3:04PM','Mar 3 2014 6:12PM' UNION ALL

    SELECT '1073722','Mar 3 2014 3:05PM','Mar 3 2014 4:38PM' UNION ALL

    SELECT '1073723','Mar 3 2014 3:05PM','Mar 3 2014 3:25PM' UNION ALL

    SELECT '1073724','Mar 3 2014 3:06PM','Mar 3 2014 3:18PM' UNION ALL

    SELECT '1073725','Mar 3 2014 3:06PM','Mar 3 2014 4:35PM' UNION ALL

    SELECT '1073726','Mar 3 2014 3:14PM','Mar 3 2014 5:40PM' UNION ALL

    SELECT '1073727','Mar 3 2014 3:18PM','Mar 3 2014 3:33PM' UNION ALL

    SELECT '1073728','Mar 3 2014 3:18PM','Mar 3 2014 3:40PM' UNION ALL

    SELECT '1073729','Mar 3 2014 3:19PM','Mar 3 2014 7:54PM' UNION ALL

    SELECT '1073730','Mar 3 2014 3:20PM','Mar 3 2014 5:49PM' UNION ALL

    SELECT '1073731','Mar 3 2014 3:20PM','Mar 3 2014 5:36PM' UNION ALL

    SELECT '1073732','Mar 3 2014 3:22PM','Mar 3 2014 5:16PM' UNION ALL

    SELECT '1073733','Mar 3 2014 3:25PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073734','Mar 3 2014 3:27PM','Mar 3 2014 6:07PM' UNION ALL

    SELECT '1073735','Mar 3 2014 3:33PM','Mar 3 2014 4:01PM' UNION ALL

    SELECT '1073736','Mar 3 2014 3:35PM','Mar 3 2014 4:35PM' UNION ALL

    SELECT '1073737','Mar 3 2014 3:36PM','Mar 3 2014 3:40PM' UNION ALL

    SELECT '1073738','Mar 3 2014 3:37PM','Mar 3 2014 4:29PM' UNION ALL

    SELECT '1073739','Mar 3 2014 3:37PM','Mar 3 2014 5:32PM' UNION ALL

    SELECT '1073740','Mar 3 2014 3:38PM','Mar 3 2014 5:32PM' UNION ALL

    SELECT '1073741','Mar 3 2014 3:40PM','Mar 3 2014 3:40PM' UNION ALL

    SELECT '1073742','Mar 3 2014 3:40PM','Mar 3 2014 7:01PM' UNION ALL

    SELECT '1073743','Mar 3 2014 3:40PM','Mar 3 2014 5:37PM' UNION ALL

    SELECT '1073744','Mar 3 2014 3:40PM','Mar 3 2014 4:02PM' UNION ALL

    SELECT '1073745','Mar 3 2014 3:44PM','Mar 3 2014 6:03PM' UNION ALL

    SELECT '1073746','Mar 3 2014 3:47PM','Mar 3 2014 6:05PM' UNION ALL

    SELECT '1073747','Mar 3 2014 3:49PM','Mar 3 2014 3:49PM' UNION ALL

    SELECT '1073748','Mar 3 2014 3:49PM','Mar 3 2014 3:50PM' UNION ALL

    SELECT '1073749','Mar 3 2014 3:51PM','Mar 3 2014 3:52PM' UNION ALL

    SELECT '1073750','Mar 3 2014 3:52PM','Mar 3 2014 6:02PM' UNION ALL

    SELECT '1073751','Mar 3 2014 3:52PM','Mar 3 2014 6:00PM' UNION ALL

    SELECT '1073752','Mar 3 2014 3:55PM','Mar 3 2014 4:36PM' UNION ALL

    SELECT '1073753','Mar 3 2014 3:57PM','Mar 3 2014 7:17PM' UNION ALL

    SELECT '1073754','Mar 3 2014 4:02PM','Mar 3 2014 4:04PM' UNION ALL

    SELECT '1073755','Mar 3 2014 4:02PM','Mar 3 2014 4:02PM' UNION ALL

    SELECT '1073756','Mar 3 2014 4:02PM','Mar 3 2014 4:03PM' UNION ALL

    SELECT '1073757','Mar 3 2014 4:03PM','Mar 3 2014 4:04PM' UNION ALL

    SELECT '1073758','Mar 3 2014 4:03PM','Mar 3 2014 5:06PM' UNION ALL

    SELECT '1073759','Mar 3 2014 4:04PM','Mar 3 2014 6:05PM' UNION ALL

    SELECT '1073760','Mar 3 2014 4:05PM','Mar 3 2014 4:33PM' UNION ALL

    SELECT '1073761','Mar 3 2014 4:29PM','Mar 3 2014 4:30PM' UNION ALL

    SELECT '1073762','Mar 3 2014 4:30PM','Mar 3 2014 4:30PM' UNION ALL

    SELECT '1073763','Mar 3 2014 4:34PM','Mar 3 2014 5:42PM' UNION ALL

    SELECT '1073764','Mar 3 2014 4:34PM','Mar 3 2014 5:29PM' UNION ALL

    SELECT '1073765','Mar 3 2014 4:36PM','Mar 3 2014 5:50PM' UNION ALL

    SELECT '1073766','Mar 3 2014 4:36PM','Mar 3 2014 5:51PM' UNION ALL

    SELECT '1073767','Mar 3 2014 4:36PM','Mar 3 2014 5:32PM' UNION ALL

    SELECT '1073768','Mar 3 2014 4:36PM','Mar 3 2014 5:51PM' UNION ALL

    SELECT '1073769','Mar 3 2014 4:38PM','Mar 3 2014 5:48PM' UNION ALL

    SELECT '1073770','Mar 3 2014 4:38PM','Mar 3 2014 5:51PM' UNION ALL

    SELECT '1073771','Mar 3 2014 4:42PM','Mar 3 2014 5:51PM' UNION ALL

    SELECT '1073772','Mar 3 2014 4:44PM','Mar 3 2014 4:44PM' UNION ALL

    SELECT '1073773','Mar 3 2014 4:44PM','Mar 3 2014 4:44PM' UNION ALL

    SELECT '1073774','Mar 3 2014 4:45PM','Mar 3 2014 4:45PM' UNION ALL

    SELECT '1073775','Mar 3 2014 4:45PM','Mar 3 2014 4:45PM' UNION ALL

    SELECT '1073776','Mar 3 2014 4:45PM','Mar 3 2014 5:51PM' UNION ALL

    SELECT '1073777','Mar 3 2014 4:46PM','Mar 3 2014 6:02PM' UNION ALL

    SELECT '1073778','Mar 3 2014 4:49PM','Mar 3 2014 5:59PM' UNION ALL

    SELECT '1073779','Mar 3 2014 4:49PM','Mar 3 2014 5:51PM' UNION ALL

    SELECT '1073780','Mar 3 2014 5:01PM','Mar 3 2014 7:19PM' UNION ALL

    SELECT '1073781','Mar 3 2014 5:07PM','Mar 3 2014 5:09PM' UNION ALL

    SELECT '1073782','Mar 3 2014 5:09PM','Mar 3 2014 5:25PM' UNION ALL

    SELECT '1073783','Mar 3 2014 5:15PM','Mar 3 2014 6:20PM' UNION ALL

    SELECT '1073784','Mar 3 2014 5:20PM','Mar 3 2014 5:32PM' UNION ALL

    SELECT '1073785','Mar 3 2014 5:25PM','Mar 3 2014 5:54PM' UNION ALL

    SELECT '1073786','Mar 3 2014 5:26PM','Mar 3 2014 5:51PM' UNION ALL

    SELECT '1073787','Mar 3 2014 5:32PM','Mar 3 2014 6:48PM' UNION ALL

    SELECT '1073788','Mar 3 2014 5:33PM','Mar 3 2014 6:11PM' UNION ALL

    SELECT '1073789','Mar 3 2014 5:34PM','Mar 3 2014 6:16PM' UNION ALL

    SELECT '1073790','Mar 3 2014 5:35PM','Mar 3 2014 7:39PM' UNION ALL

    SELECT '1073791','Mar 3 2014 5:37PM','Mar 3 2014 7:44PM' UNION ALL

    SELECT '1073792','Mar 3 2014 5:37PM','Mar 3 2014 6:02PM' UNION ALL

    SELECT '1073793','Mar 3 2014 5:38PM','Mar 3 2014 5:58PM' UNION ALL

    SELECT '1073794','Mar 3 2014 5:38PM','Mar 3 2014 5:51PM' UNION ALL

    SELECT '1073795','Mar 3 2014 5:40PM','Mar 3 2014 7:49PM' UNION ALL

    SELECT '1073796','Mar 3 2014 5:41PM','Mar 3 2014 9:16PM' UNION ALL

    SELECT '1073797','Mar 3 2014 5:42PM','Mar 3 2014 6:07PM' UNION ALL

    SELECT '1073798','Mar 3 2014 5:43PM','Mar 3 2014 5:43PM' UNION ALL

    SELECT '1073799','Mar 3 2014 5:44PM','Mar 3 2014 6:09PM' UNION ALL

    SELECT '1073800','Mar 3 2014 5:45PM','Mar 3 2014 6:30PM' UNION ALL

    SELECT '1073801','Mar 3 2014 5:48PM','Mar 3 2014 6:22PM' UNION ALL

    SELECT '1073802','Mar 3 2014 5:49PM','Mar 3 2014 5:50PM' UNION ALL

    SELECT '1073803','Mar 3 2014 5:50PM','Mar 3 2014 6:09PM' UNION ALL

    SELECT '1073804','Mar 3 2014 5:51PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073805','Mar 3 2014 5:52PM','Mar 3 2014 5:52PM' UNION ALL

    SELECT '1073806','Mar 3 2014 5:53PM','Mar 3 2014 5:57PM' UNION ALL

    SELECT '1073807','Mar 3 2014 5:54PM','Mar 3 2014 6:58PM' UNION ALL

    SELECT '1073808','Mar 3 2014 5:54PM','Mar 3 2014 5:55PM' UNION ALL

    SELECT '1073809','Mar 3 2014 5:55PM','Mar 3 2014 6:28PM' UNION ALL

    SELECT '1073810','Mar 3 2014 5:55PM','Mar 3 2014 6:12PM' UNION ALL

    SELECT '1073811','Mar 3 2014 5:58PM','Mar 3 2014 7:49PM' UNION ALL

    SELECT '1073812','Mar 3 2014 6:00PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073813','Mar 3 2014 6:02PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073814','Mar 3 2014 6:02PM','Mar 3 2014 6:24PM' UNION ALL

    SELECT '1073815','Mar 3 2014 6:03PM','Mar 3 2014 7:49PM' UNION ALL

    SELECT '1073816','Mar 3 2014 6:03PM','Mar 3 2014 8:04PM' UNION ALL

    SELECT '1073817','Mar 3 2014 6:03PM','Mar 3 2014 6:58PM' UNION ALL

    SELECT '1073818','Mar 3 2014 6:04PM','Mar 3 2014 6:28PM' UNION ALL

    SELECT '1073819','Mar 3 2014 6:05PM','Mar 3 2014 9:06PM' UNION ALL

    SELECT '1073820','Mar 3 2014 6:06PM','Mar 3 2014 6:19PM' UNION ALL

    SELECT '1073821','Mar 3 2014 6:06PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073822','Mar 3 2014 6:07PM','Mar 3 2014 6:18PM' UNION ALL

    SELECT '1073823','Mar 3 2014 6:08PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073824','Mar 3 2014 6:09PM','Mar 3 2014 6:09PM' UNION ALL

    SELECT '1073825','Mar 3 2014 6:09PM','Mar 3 2014 7:49PM' UNION ALL

    SELECT '1073826','Mar 3 2014 6:09PM','Mar 3 2014 9:00PM' UNION ALL

    SELECT '1073827','Mar 3 2014 6:10PM','Mar 3 2014 6:50PM' UNION ALL

    SELECT '1073828','Mar 3 2014 6:10PM','Mar 3 2014 9:31PM' UNION ALL

    SELECT '1073829','Mar 3 2014 6:11PM','Mar 3 2014 9:37PM' UNION ALL

    SELECT '1073830','Mar 3 2014 6:11PM','Mar 3 2014 6:21PM' UNION ALL

    SELECT '1073831','Mar 3 2014 6:11PM','Mar 3 2014 11:00PM' UNION ALL

    SELECT '1073832','Mar 3 2014 6:11PM','Mar 3 2014 8:03PM' UNION ALL

    SELECT '1073833','Mar 3 2014 6:12PM','Mar 3 2014 7:03PM' UNION ALL

    SELECT '1073834','Mar 3 2014 6:13PM','Mar 3 2014 11:33PM' UNION ALL

    SELECT '1073835','Mar 3 2014 6:14PM','Mar 3 2014 9:31PM' UNION ALL

    SELECT '1073836','Mar 3 2014 6:16PM','Mar 3 2014 8:04PM' UNION ALL

    SELECT '1073837','Mar 3 2014 6:16PM','Mar 3 2014 6:17PM' UNION ALL

    SELECT '1073838','Mar 3 2014 6:17PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073839','Mar 3 2014 6:18PM','Mar 3 2014 6:18PM' UNION ALL

    SELECT '1073840','Mar 3 2014 6:18PM','Mar 3 2014 8:04PM' UNION ALL

    SELECT '1073841','Mar 3 2014 6:18PM','Mar 3 2014 9:03PM' UNION ALL

    SELECT '1073842','Mar 3 2014 6:19PM','Mar 3 2014 6:30PM' UNION ALL

    SELECT '1073843','Mar 3 2014 6:19PM','Mar 3 2014 6:19PM' UNION ALL

    SELECT '1073844','Mar 3 2014 6:19PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073845','Mar 3 2014 6:20PM','Mar 3 2014 6:20PM' UNION ALL

    SELECT '1073846','Mar 3 2014 6:20PM','Mar 3 2014 8:01PM' UNION ALL

    SELECT '1073847','Mar 3 2014 6:21PM','Mar 3 2014 6:45PM' UNION ALL

    SELECT '1073848','Mar 3 2014 6:25PM','Mar 3 2014 6:25PM' UNION ALL

    SELECT '1073849','Mar 3 2014 6:26PM','Mar 3 2014 6:26PM' UNION ALL

    SELECT '1073850','Mar 3 2014 6:27PM','Mar 3 2014 6:34PM' UNION ALL

    SELECT '1073851','Mar 3 2014 6:30PM','Mar 3 2014 6:34PM' UNION ALL

    SELECT '1073852','Mar 3 2014 6:34PM','Mar 3 2014 6:51PM' UNION ALL

    SELECT '1073853','Mar 3 2014 6:34PM','Mar 3 2014 8:28PM' UNION ALL

    SELECT '1073854','Mar 3 2014 6:35PM','Mar 3 2014 8:20PM' UNION ALL

    SELECT '1073855','Mar 3 2014 6:36PM','Mar 3 2014 7:22PM' UNION ALL

    SELECT '1073856','Mar 3 2014 6:39PM','Mar 3 2014 8:09PM' UNION ALL

    SELECT '1073857','Mar 3 2014 6:39PM','Mar 3 2014 8:15PM' UNION ALL

    SELECT '1073858','Mar 3 2014 6:40PM','Mar 3 2014 6:57PM' UNION ALL

    SELECT '1073859','Mar 3 2014 6:42PM','Mar 3 2014 7:00PM' UNION ALL

    SELECT '1073860','Mar 3 2014 6:43PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073861','Mar 3 2014 6:44PM','Mar 3 2014 8:20PM' UNION ALL

    SELECT '1073862','Mar 3 2014 6:45PM','Mar 3 2014 6:46PM' UNION ALL

    SELECT '1073863','Mar 3 2014 6:46PM','Mar 3 2014 7:16PM' UNION ALL

    SELECT '1073864','Mar 3 2014 6:47PM','Mar 3 2014 6:53PM' UNION ALL

    SELECT '1073865','Mar 3 2014 6:48PM','Mar 3 2014 7:24PM' UNION ALL

    SELECT '1073866','Mar 3 2014 6:48PM','Mar 3 2014 7:03PM' UNION ALL

    SELECT '1073867','Mar 3 2014 6:49PM','Mar 3 2014 8:04PM' UNION ALL

    SELECT '1073868','Mar 3 2014 6:51PM','Mar 3 2014 7:04PM' UNION ALL

    SELECT '1073869','Mar 3 2014 6:51PM','Mar 3 2014 9:24PM' UNION ALL

    SELECT '1073870','Mar 3 2014 6:54PM','Mar 3 2014 8:20PM' UNION ALL

    SELECT '1073871','Mar 3 2014 6:54PM','Mar 3 2014 8:20PM' UNION ALL

    SELECT '1073872','Mar 3 2014 6:57PM','Mar 3 2014 7:09PM' UNION ALL

    SELECT '1073873','Mar 3 2014 6:57PM','Mar 3 2014 7:29PM' UNION ALL

    SELECT '1073874','Mar 3 2014 7:00PM','Mar 3 2014 9:06PM' UNION ALL

    SELECT '1073875','Mar 3 2014 7:01PM','Mar 3 2014 7:03PM' UNION ALL

    SELECT '1073876','Mar 3 2014 7:03PM','Mar 3 2014 8:20PM' UNION ALL

    SELECT '1073877','Mar 3 2014 7:03PM','Mar 3 2014 7:24PM' UNION ALL

    SELECT '1073878','Mar 3 2014 7:04PM','Mar 3 2014 7:05PM' UNION ALL

    SELECT '1073879','Mar 3 2014 7:05PM','Mar 3 2014 8:28PM' UNION ALL

    SELECT '1073880','Mar 3 2014 7:05PM','Mar 3 2014 7:06PM' UNION ALL

    SELECT '1073881','Mar 3 2014 7:06PM','Mar 3 2014 8:20PM' UNION ALL

    SELECT '1073882','Mar 3 2014 7:09PM','Mar 3 2014 8:20PM' UNION ALL

    SELECT '1073883','Mar 3 2014 7:11PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073884','Mar 3 2014 7:12PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073885','Mar 3 2014 7:15PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073886','Mar 3 2014 7:16PM','Mar 3 2014 9:21PM' UNION ALL

    SELECT '1073887','Mar 3 2014 7:17PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073888','Mar 3 2014 7:18PM','Mar 3 2014 8:04PM' UNION ALL

    SELECT '1073889','Mar 3 2014 7:21PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073890','Mar 3 2014 7:22PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073891','Mar 3 2014 7:23PM','Mar 3 2014 7:23PM' UNION ALL

    SELECT '1073892','Mar 3 2014 7:23PM','Mar 3 2014 8:25PM' UNION ALL

    SELECT '1073893','Mar 3 2014 7:24PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073894','Mar 3 2014 7:24PM','Mar 3 2014 7:38PM' UNION ALL

    SELECT '1073895','Mar 3 2014 7:27PM','Mar 3 2014 7:58PM' UNION ALL

    SELECT '1073896','Mar 3 2014 7:28PM','Mar 3 2014 8:04PM' UNION ALL

    SELECT '1073897','Mar 3 2014 7:29PM','Mar 3 2014 8:00PM' UNION ALL

    SELECT '1073898','Mar 3 2014 7:30PM','Mar 3 2014 8:09PM' UNION ALL

    SELECT '1073899','Mar 3 2014 7:34PM','Mar 3 2014 8:04PM' UNION ALL

    SELECT '1073900','Mar 3 2014 7:39PM','Mar 3 2014 7:39PM' UNION ALL

    SELECT '1073901','Mar 3 2014 7:39PM','Mar 3 2014 7:40PM' UNION ALL

    SELECT '1073902','Mar 3 2014 7:39PM','Mar 3 2014 10:05PM' UNION ALL

    SELECT '1073903','Mar 3 2014 7:39PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073904','Mar 3 2014 7:40PM','Mar 3 2014 9:31PM' UNION ALL

    SELECT '1073905','Mar 3 2014 7:41PM','Mar 3 2014 8:16PM' UNION ALL

    SELECT '1073906','Mar 3 2014 7:41PM','Mar 3 2014 7:53PM' UNION ALL

    SELECT '1073907','Mar 3 2014 7:43PM','Mar 3 2014 9:07PM' UNION ALL

    SELECT '1073908','Mar 3 2014 7:46PM','Mar 3 2014 8:34PM' UNION ALL

    SELECT '1073909','Mar 3 2014 7:46PM','Mar 3 2014 8:54PM' UNION ALL

    SELECT '1073910','Mar 3 2014 7:46PM','Mar 3 2014 9:19PM' UNION ALL

    SELECT '1073911','Mar 3 2014 7:47PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1073912','Mar 3 2014 7:47PM','Mar 3 2014 7:51PM' UNION ALL

    SELECT '1073913','Mar 3 2014 7:48PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1073914','Mar 3 2014 7:48PM','Mar 3 2014 7:55PM' UNION ALL

    SELECT '1073915','Mar 3 2014 7:48PM','Mar 3 2014 8:02PM' UNION ALL

    SELECT '1073916','Mar 3 2014 7:50PM','Mar 3 2014 11:03PM' UNION ALL

    SELECT '1073917','Mar 3 2014 7:54PM','Mar 3 2014 8:01PM' UNION ALL

    SELECT '1073918','Mar 3 2014 7:55PM','Mar 3 2014 8:46PM' UNION ALL

    SELECT '1073919','Mar 3 2014 7:56PM','Mar 3 2014 7:57PM' UNION ALL

    SELECT '1073920','Mar 3 2014 7:56PM','Mar 3 2014 8:01PM' UNION ALL

    SELECT '1073921','Mar 3 2014 7:57PM','Mar 3 2014 7:58PM' UNION ALL

    SELECT '1073922','Mar 3 2014 7:58PM','Mar 3 2014 7:59PM' UNION ALL

    SELECT '1073923','Mar 3 2014 7:58PM','Mar 3 2014 8:55PM' UNION ALL

    SELECT '1073924','Mar 3 2014 7:59PM','Mar 3 2014 9:02PM' UNION ALL

    SELECT '1073925','Mar 3 2014 7:59PM','Mar 3 2014 8:58PM' UNION ALL

    SELECT '1073926','Mar 3 2014 7:59PM','Mar 3 2014 8:02PM' UNION ALL

    SELECT '1073927','Mar 3 2014 7:59PM','Mar 3 2014 9:02PM' UNION ALL

    SELECT '1073928','Mar 3 2014 7:59PM','Mar 3 2014 9:03PM' UNION ALL

    SELECT '1073929','Mar 3 2014 7:59PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073930','Mar 3 2014 7:59PM','Mar 3 2014 9:02PM' UNION ALL

    SELECT '1073931','Mar 3 2014 7:59PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073932','Mar 3 2014 7:59PM','Mar 3 2014 8:40PM' UNION ALL

    SELECT '1073933','Mar 3 2014 8:00PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073934','Mar 3 2014 8:00PM','Mar 3 2014 9:39PM' UNION ALL

    SELECT '1073935','Mar 3 2014 8:00PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073936','Mar 3 2014 8:00PM','Mar 3 2014 8:40PM' UNION ALL

    SELECT '1073937','Mar 3 2014 8:01PM','Mar 3 2014 9:03PM' UNION ALL

    SELECT '1073938','Mar 3 2014 8:01PM','Mar 3 2014 9:02PM' UNION ALL

    SELECT '1073939','Mar 3 2014 8:01PM','Mar 3 2014 8:02PM' UNION ALL

    SELECT '1073940','Mar 3 2014 8:02PM','Mar 3 2014 8:07PM' UNION ALL

    SELECT '1073941','Mar 3 2014 8:02PM','Mar 3 2014 8:33PM' UNION ALL

    SELECT '1073942','Mar 3 2014 8:02PM','Mar 3 2014 8:03PM' UNION ALL

    SELECT '1073943','Mar 3 2014 8:03PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073944','Mar 3 2014 8:03PM','Mar 3 2014 8:05PM' UNION ALL

    SELECT '1073945','Mar 3 2014 8:03PM','Mar 3 2014 8:03PM' UNION ALL

    SELECT '1073946','Mar 3 2014 8:04PM','Mar 3 2014 8:05PM' UNION ALL

    SELECT '1073947','Mar 3 2014 8:04PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073948','Mar 3 2014 8:05PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073949','Mar 3 2014 8:05PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073950','Mar 3 2014 8:05PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073951','Mar 3 2014 8:06PM','Mar 3 2014 8:06PM' UNION ALL

    SELECT '1073952','Mar 3 2014 8:06PM','Mar 3 2014 8:44PM' UNION ALL

    SELECT '1073953','Mar 3 2014 8:06PM','Mar 3 2014 8:06PM' UNION ALL

    SELECT '1073954','Mar 3 2014 8:06PM','Mar 3 2014 8:14PM' UNION ALL

    SELECT '1073955','Mar 3 2014 8:06PM','Mar 3 2014 8:11PM' UNION ALL

    SELECT '1073956','Mar 3 2014 8:07PM','Mar 3 2014 9:28PM' UNION ALL

    SELECT '1073957','Mar 3 2014 8:08PM','Mar 3 2014 8:10PM' UNION ALL

    SELECT '1073958','Mar 3 2014 8:08PM','Mar 3 2014 8:38PM' UNION ALL

    SELECT '1073959','Mar 3 2014 8:08PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1073960','Mar 3 2014 8:09PM','Mar 3 2014 8:57PM' UNION ALL

    SELECT '1073961','Mar 3 2014 8:10PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073962','Mar 3 2014 8:10PM','Mar 3 2014 8:37PM' UNION ALL

    SELECT '1073963','Mar 3 2014 8:11PM','Mar 3 2014 8:34PM' UNION ALL

    SELECT '1073964','Mar 3 2014 8:11PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073965','Mar 3 2014 8:11PM','Mar 3 2014 8:24PM' UNION ALL

    SELECT '1073966','Mar 3 2014 8:15PM','Mar 3 2014 8:16PM' UNION ALL

    SELECT '1073967','Mar 3 2014 8:16PM','Mar 3 2014 9:02PM' UNION ALL

    SELECT '1073968','Mar 3 2014 8:17PM','Mar 3 2014 8:40PM' UNION ALL

    SELECT '1073969','Mar 3 2014 8:17PM','Mar 3 2014 8:18PM' UNION ALL

    SELECT '1073970','Mar 3 2014 8:18PM','Mar 3 2014 9:38PM' UNION ALL

    SELECT '1073971','Mar 3 2014 8:19PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1073972','Mar 3 2014 8:21PM','Mar 3 2014 8:55PM' UNION ALL

    SELECT '1073973','Mar 3 2014 8:24PM','Mar 3 2014 8:39PM' UNION ALL

    SELECT '1073974','Mar 3 2014 8:28PM','Mar 3 2014 9:14PM' UNION ALL

    SELECT '1073975','Mar 3 2014 8:32PM','Mar 3 2014 9:05PM' UNION ALL

    SELECT '1073976','Mar 3 2014 8:33PM','Mar 3 2014 10:00PM' UNION ALL

    SELECT '1073977','Mar 3 2014 8:34PM','Mar 3 2014 8:34PM' UNION ALL

    SELECT '1073978','Mar 3 2014 8:36PM','Mar 3 2014 8:37PM' UNION ALL

    SELECT '1073979','Mar 3 2014 8:37PM','Mar 3 2014 8:37PM' UNION ALL

    SELECT '1073980','Mar 3 2014 8:37PM','Mar 3 2014 8:55PM' UNION ALL

    SELECT '1073981','Mar 3 2014 8:37PM','Mar 3 2014 8:53PM' UNION ALL

    SELECT '1073982','Mar 3 2014 8:39PM','Mar 3 2014 8:55PM' UNION ALL

    SELECT '1073983','Mar 3 2014 8:40PM','Mar 3 2014 8:42PM' UNION ALL

    SELECT '1073984','Mar 3 2014 8:40PM','Mar 3 2014 10:42PM' UNION ALL

    SELECT '1073985','Mar 3 2014 8:41PM','Mar 3 2014 8:41PM' UNION ALL

    SELECT '1073986','Mar 3 2014 8:42PM','Mar 3 2014 9:24PM' UNION ALL

    SELECT '1073987','Mar 3 2014 8:42PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073988','Mar 3 2014 8:42PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1073989','Mar 3 2014 8:43PM','Mar 3 2014 8:58PM' UNION ALL

    SELECT '1073990','Mar 3 2014 8:44PM','Mar 3 2014 9:07PM' UNION ALL

    SELECT '1073991','Mar 3 2014 8:44PM','Mar 3 2014 8:45PM' UNION ALL

    SELECT '1073992','Mar 3 2014 8:45PM','Mar 3 2014 9:15PM' UNION ALL

    SELECT '1073993','Mar 3 2014 8:47PM','Mar 3 2014 8:50PM' UNION ALL

    SELECT '1073994','Mar 3 2014 8:51PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1073995','Mar 3 2014 8:51PM','Mar 3 2014 9:01PM' UNION ALL

    SELECT '1073996','Mar 3 2014 8:54PM','Mar 3 2014 8:54PM' UNION ALL

    SELECT '1073997','Mar 3 2014 8:54PM','Mar 3 2014 8:55PM' UNION ALL

    SELECT '1073998','Mar 3 2014 8:55PM','Mar 3 2014 8:57PM' UNION ALL

    SELECT '1073999','Mar 3 2014 8:55PM','Mar 3 2014 10:03PM' UNION ALL

    SELECT '1074000','Mar 3 2014 8:56PM','Mar 3 2014 9:56PM' UNION ALL

    SELECT '1074001','Mar 3 2014 8:56PM','Mar 3 2014 9:12PM' UNION ALL

    SELECT '1074002','Mar 3 2014 8:56PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1074003','Mar 3 2014 8:58PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1074004','Mar 3 2014 8:58PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074005','Mar 3 2014 8:58PM','Mar 3 2014 8:58PM' UNION ALL

    SELECT '1074006','Mar 3 2014 8:58PM','Mar 3 2014 9:02PM' UNION ALL

    SELECT '1074007','Mar 3 2014 8:58PM','Mar 3 2014 9:01PM' UNION ALL

    SELECT '1074008','Mar 3 2014 8:58PM','Mar 3 2014 8:58PM' UNION ALL

    SELECT '1074009','Mar 3 2014 8:58PM','Mar 3 2014 9:03PM' UNION ALL

    SELECT '1074010','Mar 3 2014 8:58PM','Mar 3 2014 8:58PM' UNION ALL

    SELECT '1074011','Mar 3 2014 8:58PM','Mar 3 2014 10:00PM' UNION ALL

    SELECT '1074012','Mar 3 2014 8:58PM','Mar 3 2014 9:06PM' UNION ALL

    SELECT '1074013','Mar 3 2014 8:58PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074014','Mar 3 2014 8:58PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074015','Mar 3 2014 8:58PM','Mar 3 2014 9:03PM' UNION ALL

    SELECT '1074016','Mar 3 2014 8:59PM','Mar 3 2014 10:32PM' UNION ALL

    SELECT '1074017','Mar 3 2014 8:59PM','Mar 3 2014 8:59PM' UNION ALL

    SELECT '1074018','Mar 3 2014 8:59PM','Mar 3 2014 9:19PM' UNION ALL

    SELECT '1074019','Mar 3 2014 9:00PM','Mar 3 2014 9:00PM' UNION ALL

    SELECT '1074020','Mar 3 2014 9:00PM','Mar 3 2014 9:03PM' UNION ALL

    SELECT '1074021','Mar 3 2014 9:00PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074022','Mar 3 2014 9:00PM','Mar 3 2014 9:03PM' UNION ALL

    SELECT '1074023','Mar 3 2014 9:00PM','Mar 3 2014 9:13PM' UNION ALL

    SELECT '1074024','Mar 3 2014 9:00PM','Mar 3 2014 9:03PM' UNION ALL

    SELECT '1074025','Mar 3 2014 9:01PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074026','Mar 3 2014 9:01PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074027','Mar 3 2014 9:01PM','Mar 3 2014 10:07PM' UNION ALL

    SELECT '1074028','Mar 3 2014 9:01PM','Mar 3 2014 9:02PM' UNION ALL

    SELECT '1074029','Mar 3 2014 9:01PM','Mar 3 2014 9:41PM' UNION ALL

    SELECT '1074030','Mar 3 2014 9:02PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074031','Mar 3 2014 9:02PM','Mar 3 2014 9:30PM' UNION ALL

    SELECT '1074032','Mar 3 2014 9:03PM','Mar 4 2014 2:01AM' UNION ALL

    SELECT '1074033','Mar 3 2014 9:03PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074034','Mar 3 2014 9:03PM','Mar 3 2014 9:04PM' UNION ALL

    SELECT '1074035','Mar 3 2014 9:03PM','Mar 3 2014 9:24PM' UNION ALL

    SELECT '1074036','Mar 3 2014 9:05PM','Mar 3 2014 11:00PM' UNION ALL

    SELECT '1074037','Mar 3 2014 9:06PM','Mar 3 2014 9:58PM' UNION ALL

    SELECT '1074038','Mar 3 2014 9:06PM','Mar 3 2014 10:08PM' UNION ALL

    SELECT '1074039','Mar 3 2014 9:06PM','Mar 3 2014 9:52PM' UNION ALL

    SELECT '1074040','Mar 3 2014 9:06PM','Mar 3 2014 9:58PM' UNION ALL

    SELECT '1074041','Mar 3 2014 9:06PM','Mar 3 2014 10:05PM' UNION ALL

    SELECT '1074042','Mar 3 2014 9:06PM','Mar 3 2014 9:06PM' UNION ALL

    SELECT '1074043','Mar 3 2014 9:06PM','Mar 3 2014 10:08PM' UNION ALL

    SELECT '1074044','Mar 3 2014 9:06PM','Mar 3 2014 9:59PM' UNION ALL

    SELECT '1074045','Mar 3 2014 9:06PM','Mar 3 2014 9:59PM' UNION ALL

    SELECT '1074046','Mar 3 2014 9:06PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074047','Mar 3 2014 9:07PM','Mar 3 2014 10:01PM' UNION ALL

    SELECT '1074048','Mar 3 2014 9:07PM','Mar 3 2014 10:08PM' UNION ALL

    SELECT '1074049','Mar 3 2014 9:07PM','Mar 3 2014 9:11PM' UNION ALL

    SELECT '1074050','Mar 3 2014 9:07PM','Mar 3 2014 9:59PM' UNION ALL

    SELECT '1074051','Mar 3 2014 9:07PM','Mar 3 2014 9:33PM' UNION ALL

    SELECT '1074052','Mar 3 2014 9:08PM','Mar 3 2014 9:59PM' UNION ALL

    SELECT '1074053','Mar 3 2014 9:08PM','Mar 3 2014 9:09PM' UNION ALL

    SELECT '1074054','Mar 3 2014 9:10PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074055','Mar 3 2014 9:10PM','Mar 3 2014 9:59PM' UNION ALL

    SELECT '1074056','Mar 3 2014 9:11PM','Mar 3 2014 10:12PM' UNION ALL

    SELECT '1074057','Mar 3 2014 9:11PM','Mar 3 2014 9:59PM' UNION ALL

    SELECT '1074058','Mar 3 2014 9:12PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074059','Mar 3 2014 9:12PM','Mar 3 2014 9:16PM' UNION ALL

    SELECT '1074060','Mar 3 2014 9:12PM','Mar 3 2014 10:15PM' UNION ALL

    SELECT '1074061','Mar 3 2014 9:12PM','Mar 3 2014 9:36PM' UNION ALL

    SELECT '1074062','Mar 3 2014 9:13PM','Mar 3 2014 9:34PM' UNION ALL

    SELECT '1074063','Mar 3 2014 9:14PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074064','Mar 3 2014 9:14PM','Mar 3 2014 10:19PM' UNION ALL

    SELECT '1074065','Mar 3 2014 9:16PM','Mar 3 2014 9:17PM' UNION ALL

    SELECT '1074066','Mar 3 2014 9:17PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074067','Mar 3 2014 9:17PM','Mar 3 2014 9:21PM' UNION ALL

    SELECT '1074068','Mar 3 2014 9:17PM','Mar 3 2014 9:18PM' UNION ALL

    SELECT '1074069','Mar 3 2014 9:17PM','Mar 3 2014 9:28PM' UNION ALL

    SELECT '1074070','Mar 3 2014 9:18PM','Mar 3 2014 9:18PM' UNION ALL

    SELECT '1074071','Mar 3 2014 9:18PM','Mar 3 2014 9:19PM' UNION ALL

    SELECT '1074072','Mar 3 2014 9:20PM','Mar 3 2014 9:20PM' UNION ALL

    SELECT '1074073','Mar 3 2014 9:20PM','Mar 3 2014 9:57PM' UNION ALL

    SELECT '1074074','Mar 3 2014 9:21PM','Mar 3 2014 9:22PM' UNION ALL

    SELECT '1074075','Mar 3 2014 9:22PM','Mar 3 2014 10:50PM' UNION ALL

    SELECT '1074076','Mar 3 2014 9:23PM','Mar 3 2014 9:23PM' UNION ALL

    SELECT '1074077','Mar 3 2014 9:23PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074078','Mar 3 2014 9:23PM','Mar 3 2014 11:03PM' UNION ALL

    SELECT '1074079','Mar 3 2014 9:24PM','Mar 3 2014 9:28PM' UNION ALL

    SELECT '1074080','Mar 3 2014 9:25PM','Mar 3 2014 9:58PM' UNION ALL

    SELECT '1074081','Mar 3 2014 9:26PM','Mar 3 2014 9:59PM' UNION ALL

    SELECT '1074082','Mar 3 2014 9:27PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074083','Mar 3 2014 9:27PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074084','Mar 3 2014 9:27PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074085','Mar 3 2014 9:28PM','Mar 3 2014 10:57PM' UNION ALL

    SELECT '1074086','Mar 3 2014 9:28PM','Mar 3 2014 9:29PM' UNION ALL

    SELECT '1074087','Mar 3 2014 9:29PM','Mar 3 2014 9:30PM' UNION ALL

    SELECT '1074088','Mar 3 2014 9:29PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074089','Mar 3 2014 9:29PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074090','Mar 3 2014 9:29PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074091','Mar 3 2014 9:30PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074092','Mar 3 2014 9:30PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074093','Mar 3 2014 9:30PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074094','Mar 3 2014 9:30PM','Mar 3 2014 10:23PM' UNION ALL

    SELECT '1074095','Mar 3 2014 9:30PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074096','Mar 3 2014 9:31PM','Mar 3 2014 9:33PM' UNION ALL

    SELECT '1074097','Mar 3 2014 9:31PM','Mar 3 2014 11:33PM' UNION ALL

    SELECT '1074098','Mar 3 2014 9:31PM','Mar 3 2014 10:57PM' UNION ALL

    SELECT '1074099','Mar 3 2014 9:33PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074100','Mar 3 2014 9:34PM','Mar 3 2014 9:34PM' UNION ALL

    SELECT '1074101','Mar 3 2014 9:34PM','Mar 3 2014 9:37PM' UNION ALL

    SELECT '1074102','Mar 3 2014 9:34PM','Mar 3 2014 9:34PM' UNION ALL

    SELECT '1074103','Mar 3 2014 9:34PM','Mar 3 2014 9:38PM' UNION ALL

    SELECT '1074104','Mar 3 2014 9:36PM','Mar 3 2014 9:37PM' UNION ALL

    SELECT '1074105','Mar 3 2014 9:37PM','Mar 3 2014 9:37PM' UNION ALL

    SELECT '1074106','Mar 3 2014 9:37PM','Mar 3 2014 10:17PM' UNION ALL

    SELECT '1074107','Mar 3 2014 9:37PM','Mar 3 2014 9:59PM' UNION ALL

    SELECT '1074108','Mar 3 2014 9:38PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074109','Mar 3 2014 9:38PM','Mar 3 2014 9:52PM' UNION ALL

    SELECT '1074110','Mar 3 2014 9:39PM','Mar 3 2014 9:40PM' UNION ALL

    SELECT '1074111','Mar 3 2014 9:40PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074112','Mar 3 2014 9:41PM','Mar 3 2014 9:42PM' UNION ALL

    SELECT '1074113','Mar 3 2014 9:42PM','Mar 3 2014 9:42PM' UNION ALL

    SELECT '1074114','Mar 3 2014 9:42PM','Mar 3 2014 9:42PM' UNION ALL

    SELECT '1074115','Mar 3 2014 9:43PM','Mar 3 2014 10:04PM' UNION ALL

    SELECT '1074116','Mar 3 2014 9:52PM','Mar 3 2014 9:58PM' UNION ALL

    SELECT '1074117','Mar 3 2014 9:53PM','Mar 3 2014 10:06PM' UNION ALL

    SELECT '1074118','Mar 3 2014 9:57PM','Mar 3 2014 9:58PM' UNION ALL

    SELECT '1074119','Mar 3 2014 9:57PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074120','Mar 3 2014 9:58PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074121','Mar 3 2014 9:59PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074122','Mar 3 2014 9:59PM','Mar 3 2014 10:00PM' UNION ALL

    SELECT '1074123','Mar 3 2014 9:59PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074124','Mar 3 2014 9:59PM','Mar 3 2014 11:05PM' UNION ALL

    SELECT '1074125','Mar 3 2014 9:59PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074126','Mar 3 2014 9:59PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074127','Mar 3 2014 9:59PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074128','Mar 3 2014 9:59PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074129','Mar 3 2014 9:59PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074130','Mar 3 2014 9:59PM','Mar 3 2014 11:05PM' UNION ALL

    SELECT '1074131','Mar 3 2014 10:00PM','Mar 3 2014 11:05PM' UNION ALL

    SELECT '1074132','Mar 3 2014 10:00PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074133','Mar 3 2014 10:00PM','Mar 3 2014 11:25PM' UNION ALL

    SELECT '1074134','Mar 3 2014 10:00PM','Mar 3 2014 11:08PM' UNION ALL

    SELECT '1074135','Mar 3 2014 10:01PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074136','Mar 3 2014 10:01PM','Mar 3 2014 11:14PM' UNION ALL

    SELECT '1074137','Mar 3 2014 10:03PM','Mar 3 2014 10:51PM' UNION ALL

    SELECT '1074138','Mar 3 2014 10:05PM','Mar 3 2014 10:07PM' UNION ALL

    SELECT '1074139','Mar 3 2014 10:06PM','Mar 3 2014 10:23PM' UNION ALL

    SELECT '1074140','Mar 3 2014 10:07PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074141','Mar 3 2014 10:07PM','Mar 3 2014 10:09PM' UNION ALL

    SELECT '1074142','Mar 3 2014 10:08PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074143','Mar 3 2014 10:08PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074144','Mar 3 2014 10:09PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074145','Mar 3 2014 10:09PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074146','Mar 3 2014 10:11PM','Mar 3 2014 11:14PM' UNION ALL

    SELECT '1074147','Mar 3 2014 10:12PM','Mar 3 2014 11:00PM' UNION ALL

    SELECT '1074148','Mar 3 2014 10:13PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074149','Mar 3 2014 10:15PM','Mar 3 2014 10:48PM' UNION ALL

    SELECT '1074150','Mar 3 2014 10:15PM','Mar 3 2014 10:53PM' UNION ALL

    SELECT '1074151','Mar 3 2014 10:17PM','Mar 3 2014 10:18PM' UNION ALL

    SELECT '1074152','Mar 3 2014 10:18PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074153','Mar 3 2014 10:19PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074154','Mar 3 2014 10:19PM','Mar 3 2014 10:19PM' UNION ALL

    SELECT '1074155','Mar 3 2014 10:19PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074156','Mar 3 2014 10:19PM','Mar 3 2014 10:20PM' UNION ALL

    SELECT '1074157','Mar 3 2014 10:19PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074158','Mar 3 2014 10:19PM','Mar 3 2014 10:30PM' UNION ALL

    SELECT '1074159','Mar 3 2014 10:19PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074160','Mar 3 2014 10:19PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074161','Mar 3 2014 10:19PM','Mar 3 2014 10:34PM' UNION ALL

    SELECT '1074162','Mar 3 2014 10:19PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074163','Mar 3 2014 10:20PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074164','Mar 3 2014 10:20PM','Mar 3 2014 10:36PM' UNION ALL

    SELECT '1074165','Mar 3 2014 10:20PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074166','Mar 3 2014 10:20PM','Mar 3 2014 10:27PM' UNION ALL

    SELECT '1074167','Mar 3 2014 10:21PM','Mar 3 2014 10:23PM' UNION ALL

    SELECT '1074168','Mar 3 2014 10:22PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074169','Mar 3 2014 10:22PM','Mar 3 2014 10:29PM' UNION ALL

    SELECT '1074170','Mar 3 2014 10:23PM','Mar 3 2014 10:31PM' UNION ALL

    SELECT '1074171','Mar 3 2014 10:23PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074172','Mar 3 2014 10:24PM','Mar 3 2014 10:26PM' UNION ALL

    SELECT '1074173','Mar 3 2014 10:24PM','Mar 3 2014 10:24PM' UNION ALL

    SELECT '1074174','Mar 3 2014 10:25PM','Mar 3 2014 10:36PM' UNION ALL

    SELECT '1074175','Mar 3 2014 10:27PM','Mar 3 2014 10:40PM' UNION ALL

    SELECT '1074176','Mar 3 2014 10:27PM','Mar 3 2014 10:28PM' UNION ALL

    SELECT '1074177','Mar 3 2014 10:28PM','Mar 3 2014 10:40PM' UNION ALL

    SELECT '1074178','Mar 3 2014 10:28PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074179','Mar 3 2014 10:28PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074180','Mar 3 2014 10:28PM','Mar 3 2014 10:47PM' UNION ALL

    SELECT '1074181','Mar 3 2014 10:28PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074182','Mar 3 2014 10:28PM','Mar 3 2014 10:43PM' UNION ALL

    SELECT '1074183','Mar 3 2014 10:28PM','Mar 3 2014 10:46PM' UNION ALL

    SELECT '1074184','Mar 3 2014 10:29PM','Mar 3 2014 10:45PM' UNION ALL

    SELECT '1074185','Mar 3 2014 10:29PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074186','Mar 3 2014 10:29PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074187','Mar 3 2014 10:29PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074188','Mar 3 2014 10:29PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074189','Mar 3 2014 10:30PM','Mar 3 2014 10:47PM' UNION ALL

    SELECT '1074190','Mar 3 2014 10:30PM','Mar 3 2014 10:38PM' UNION ALL

    SELECT '1074191','Mar 3 2014 10:31PM','Mar 3 2014 10:45PM' UNION ALL

    SELECT '1074192','Mar 3 2014 10:35PM','Mar 3 2014 10:40PM' UNION ALL

    SELECT '1074193','Mar 3 2014 10:36PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074194','Mar 3 2014 10:37PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074195','Mar 3 2014 10:37PM','Mar 4 2014 12:39AM' UNION ALL

    SELECT '1074196','Mar 3 2014 10:37PM','Mar 3 2014 11:25PM' UNION ALL

    SELECT '1074197','Mar 3 2014 10:37PM','Mar 3 2014 11:30PM' UNION ALL

    SELECT '1074198','Mar 3 2014 10:37PM','Mar 3 2014 10:38PM' UNION ALL

    SELECT '1074199','Mar 3 2014 10:37PM','Mar 3 2014 10:37PM' UNION ALL

    SELECT '1074200','Mar 3 2014 10:37PM','Mar 3 2014 11:36PM' UNION ALL

    SELECT '1074201','Mar 3 2014 10:37PM','Mar 4 2014 1:19AM' UNION ALL

    SELECT '1074202','Mar 3 2014 10:37PM','Mar 3 2014 10:38PM' UNION ALL

    SELECT '1074203','Mar 3 2014 10:37PM','Mar 4 2014 12:33AM' UNION ALL

    SELECT '1074204','Mar 3 2014 10:37PM','Mar 3 2014 11:00PM' UNION ALL

    SELECT '1074205','Mar 3 2014 10:38PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074206','Mar 3 2014 10:38PM','Mar 3 2014 10:38PM' UNION ALL

    SELECT '1074207','Mar 3 2014 10:38PM','Mar 3 2014 11:59PM' UNION ALL

    SELECT '1074208','Mar 3 2014 10:38PM','Mar 3 2014 10:47PM' UNION ALL

    SELECT '1074209','Mar 3 2014 10:38PM','Mar 3 2014 10:39PM' UNION ALL

    SELECT '1074210','Mar 3 2014 10:38PM','Mar 3 2014 10:39PM' UNION ALL

    SELECT '1074211','Mar 3 2014 10:39PM','Mar 3 2014 10:39PM' UNION ALL

    SELECT '1074212','Mar 3 2014 10:40PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074213','Mar 3 2014 10:40PM','Mar 3 2014 11:01PM' UNION ALL

    SELECT '1074214','Mar 3 2014 10:40PM','Mar 3 2014 11:22PM' UNION ALL

    SELECT '1074215','Mar 3 2014 10:40PM','Mar 4 2014 12:30AM' UNION ALL

    SELECT '1074216','Mar 3 2014 10:45PM','Mar 3 2014 11:01PM' UNION ALL

    SELECT '1074217','Mar 3 2014 10:45PM','Mar 3 2014 11:04PM' UNION ALL

    SELECT '1074218','Mar 3 2014 10:46PM','Mar 3 2014 11:18PM' UNION ALL

    SELECT '1074219','Mar 3 2014 10:46PM','Mar 3 2014 10:56PM' UNION ALL

    SELECT '1074220','Mar 3 2014 10:46PM','Mar 3 2014 11:10PM' UNION ALL

    SELECT '1074221','Mar 3 2014 10:47PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074222','Mar 3 2014 10:47PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074223','Mar 3 2014 10:47PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074224','Mar 3 2014 10:47PM','Mar 3 2014 10:48PM' UNION ALL

    SELECT '1074225','Mar 3 2014 10:48PM','Mar 4 2014 12:38AM' UNION ALL

    SELECT '1074226','Mar 3 2014 10:48PM','Mar 3 2014 11:00PM' UNION ALL

    SELECT '1074227','Mar 3 2014 10:48PM','Mar 3 2014 11:00PM' UNION ALL

    SELECT '1074228','Mar 3 2014 10:48PM','Mar 3 2014 10:48PM' UNION ALL

    SELECT '1074229','Mar 3 2014 10:48PM','Mar 3 2014 10:51PM' UNION ALL

    SELECT '1074230','Mar 3 2014 10:48PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074231','Mar 3 2014 10:49PM','Mar 3 2014 10:50PM' UNION ALL

    SELECT '1074232','Mar 3 2014 10:50PM','Mar 3 2014 10:51PM' UNION ALL

    SELECT '1074233','Mar 3 2014 10:51PM','Mar 3 2014 11:03PM' UNION ALL

    SELECT '1074234','Mar 3 2014 10:51PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074235','Mar 3 2014 10:52PM','Mar 3 2014 11:04PM' UNION ALL

    SELECT '1074236','Mar 3 2014 10:52PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074237','Mar 3 2014 10:52PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074238','Mar 3 2014 10:53PM','Mar 3 2014 11:26PM' UNION ALL

    SELECT '1074239','Mar 3 2014 10:53PM','Mar 3 2014 11:07PM' UNION ALL

    SELECT '1074240','Mar 3 2014 10:54PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074241','Mar 3 2014 10:55PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074242','Mar 3 2014 10:58PM','Mar 3 2014 10:58PM' UNION ALL

    SELECT '1074243','Mar 3 2014 10:58PM','Mar 4 2014 12:09AM' UNION ALL

    SELECT '1074244','Mar 3 2014 10:58PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074245','Mar 3 2014 10:58PM','Mar 3 2014 11:33PM' UNION ALL

    SELECT '1074246','Mar 3 2014 10:58PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074247','Mar 3 2014 10:59PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074248','Mar 3 2014 10:59PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074249','Mar 3 2014 10:59PM','Mar 3 2014 11:11PM' UNION ALL

    SELECT '1074250','Mar 3 2014 10:59PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074251','Mar 3 2014 10:59PM','Mar 3 2014 11:04PM' UNION ALL

    SELECT '1074252','Mar 3 2014 10:59PM','Mar 3 2014 11:00PM' UNION ALL

    SELECT '1074253','Mar 3 2014 10:59PM','Mar 4 2014 12:59AM' UNION ALL

    SELECT '1074254','Mar 3 2014 10:59PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074255','Mar 3 2014 10:59PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074256','Mar 3 2014 10:59PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074257','Mar 3 2014 10:59PM','Mar 3 2014 10:59PM' UNION ALL

    SELECT '1074258','Mar 3 2014 10:59PM','Mar 4 2014 12:35AM' UNION ALL

    SELECT '1074259','Mar 3 2014 10:59PM','Mar 4 2014 1:10AM' UNION ALL

    SELECT '1074260','Mar 3 2014 10:59PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074261','Mar 3 2014 10:59PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074262','Mar 3 2014 10:59PM','Mar 4 2014 12:59AM' UNION ALL

    SELECT '1074263','Mar 3 2014 11:00PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074264','Mar 3 2014 11:00PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074265','Mar 3 2014 11:00PM','Mar 4 2014 12:04AM' UNION ALL

    SELECT '1074266','Mar 3 2014 11:00PM','Mar 3 2014 11:13PM' UNION ALL

    SELECT '1074267','Mar 3 2014 11:00PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074268','Mar 3 2014 11:00PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074269','Mar 3 2014 11:00PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074270','Mar 3 2014 11:01PM','Mar 4 2014 12:35AM' UNION ALL

    SELECT '1074271','Mar 3 2014 11:01PM','Mar 4 2014 12:10AM' UNION ALL

    SELECT '1074272','Mar 3 2014 11:01PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074273','Mar 3 2014 11:01PM','Mar 4 2014 1:10AM' UNION ALL

    SELECT '1074274','Mar 3 2014 11:01PM','Mar 3 2014 11:08PM' UNION ALL

    SELECT '1074275','Mar 3 2014 11:01PM','Mar 3 2014 11:02PM' UNION ALL

    SELECT '1074276','Mar 3 2014 11:02PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074277','Mar 3 2014 11:02PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074278','Mar 3 2014 11:02PM','Mar 4 2014 12:29AM' UNION ALL

    SELECT '1074279','Mar 3 2014 11:03PM','Mar 3 2014 11:04PM' UNION ALL

    SELECT '1074280','Mar 3 2014 11:03PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074281','Mar 3 2014 11:03PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074282','Mar 3 2014 11:03PM','Mar 4 2014 1:10AM' UNION ALL

    SELECT '1074283','Mar 3 2014 11:04PM','Mar 3 2014 11:16PM' UNION ALL

    SELECT '1074284','Mar 3 2014 11:04PM','Mar 3 2014 11:06PM' UNION ALL

    SELECT '1074285','Mar 3 2014 11:05PM','Mar 3 2014 11:20PM' UNION ALL

    SELECT '1074286','Mar 3 2014 11:05PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074287','Mar 3 2014 11:05PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074288','Mar 3 2014 11:05PM','Mar 3 2014 11:12PM' UNION ALL

    SELECT '1074289','Mar 3 2014 11:06PM','Mar 3 2014 11:43PM' UNION ALL

    SELECT '1074290','Mar 3 2014 11:06PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074291','Mar 3 2014 11:07PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074292','Mar 3 2014 11:07PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074293','Mar 3 2014 11:07PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074294','Mar 3 2014 11:07PM','Mar 3 2014 11:08PM' UNION ALL

    SELECT '1074295','Mar 3 2014 11:08PM','Mar 3 2014 11:08PM' UNION ALL

    SELECT '1074296','Mar 3 2014 11:09PM','Mar 3 2014 11:32PM' UNION ALL

    SELECT '1074297','Mar 3 2014 11:09PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074298','Mar 3 2014 11:10PM','Mar 3 2014 11:11PM' UNION ALL

    SELECT '1074299','Mar 3 2014 11:10PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074300','Mar 3 2014 11:11PM','Mar 3 2014 11:11PM' UNION ALL

    SELECT '1074301','Mar 3 2014 11:11PM','Mar 4 2014 12:14AM' UNION ALL

    SELECT '1074302','Mar 3 2014 11:11PM','Mar 4 2014 1:51AM' UNION ALL

    SELECT '1074303','Mar 3 2014 11:12PM','Mar 3 2014 11:39PM' UNION ALL

    SELECT '1074304','Mar 3 2014 11:12PM','Mar 4 2014 12:42AM' UNION ALL

    SELECT '1074305','Mar 3 2014 11:12PM','Mar 3 2014 11:15PM' UNION ALL

    SELECT '1074306','Mar 3 2014 11:14PM','Mar 4 2014 2:01AM' UNION ALL

    SELECT '1074307','Mar 3 2014 11:15PM','Mar 3 2014 11:31PM' UNION ALL

    SELECT '1074308','Mar 3 2014 11:17PM','Mar 4 2014 12:31AM' UNION ALL

    SELECT '1074309','Mar 3 2014 11:18PM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074310','Mar 3 2014 11:18PM','Mar 3 2014 11:19PM' UNION ALL

    SELECT '1074311','Mar 3 2014 11:19PM','Mar 3 2014 11:25PM' UNION ALL

    SELECT '1074312','Mar 3 2014 11:20PM','Mar 3 2014 11:21PM' UNION ALL

    SELECT '1074313','Mar 3 2014 11:21PM','Mar 4 2014 12:30AM' UNION ALL

    SELECT '1074314','Mar 3 2014 11:25PM','Mar 3 2014 11:25PM' UNION ALL

    SELECT '1074315','Mar 3 2014 11:25PM','Mar 3 2014 11:29PM' UNION ALL

    SELECT '1074316','Mar 3 2014 11:26PM','Mar 3 2014 11:41PM' UNION ALL

    SELECT '1074317','Mar 3 2014 11:29PM','Mar 4 2014 12:18AM' UNION ALL

    SELECT '1074318','Mar 3 2014 11:30PM','Mar 3 2014 11:42PM' UNION ALL

    SELECT '1074319','Mar 3 2014 11:31PM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074320','Mar 3 2014 11:32PM','Mar 4 2014 1:10AM' UNION ALL

    SELECT '1074321','Mar 3 2014 11:32PM','Mar 4 2014 12:59AM' UNION ALL

    SELECT '1074322','Mar 3 2014 11:34PM','Mar 4 2014 1:05AM' UNION ALL

    SELECT '1074323','Mar 3 2014 11:39PM','Mar 4 2014 12:43AM' UNION ALL

    SELECT '1074324','Mar 3 2014 11:41PM','Mar 3 2014 11:45PM' UNION ALL

    SELECT '1074325','Mar 3 2014 11:43PM','Mar 4 2014 12:18AM' UNION ALL

    SELECT '1074326','Mar 3 2014 11:43PM','Mar 3 2014 11:44PM' UNION ALL

    SELECT '1074327','Mar 3 2014 11:44PM','Mar 4 2014 12:18AM' UNION ALL

    SELECT '1074328','Mar 3 2014 11:45PM','Mar 3 2014 11:58PM' UNION ALL

    SELECT '1074329','Mar 3 2014 11:58PM','Mar 3 2014 11:59PM' UNION ALL

    SELECT '1074330','Mar 3 2014 11:59PM','Mar 4 2014 12:00AM' UNION ALL

    SELECT '1074331','Mar 3 2014 11:59PM','Mar 4 2014 12:00AM' UNION ALL

    SELECT '1074332','Mar 4 2014 12:00AM','Mar 4 2014 12:36AM' UNION ALL

    SELECT '1074333','Mar 4 2014 12:00AM','Mar 4 2014 12:01AM' UNION ALL

    SELECT '1074334','Mar 4 2014 12:01AM','Mar 4 2014 12:41AM' UNION ALL

    SELECT '1074335','Mar 4 2014 12:09AM','Mar 4 2014 12:40AM' UNION ALL

    SELECT '1074336','Mar 4 2014 12:10AM','Mar 4 2014 12:30AM' UNION ALL

    SELECT '1074337','Mar 4 2014 12:14AM','Mar 4 2014 12:14AM' UNION ALL

    SELECT '1074338','Mar 4 2014 12:15AM','Mar 4 2014 12:31AM' UNION ALL

    SELECT '1074339','Mar 4 2014 12:18AM','Mar 4 2014 12:38AM' UNION ALL

    SELECT '1074340','Mar 4 2014 12:18AM','Mar 4 2014 12:18AM' UNION ALL

    SELECT '1074341','Mar 4 2014 12:18AM','Mar 4 2014 12:19AM' UNION ALL

    SELECT '1074342','Mar 4 2014 12:19AM','Mar 4 2014 2:31AM' UNION ALL

    SELECT '1074343','Mar 4 2014 12:19AM','Mar 4 2014 12:19AM' UNION ALL

    SELECT '1074344','Mar 4 2014 12:19AM','Mar 4 2014 12:43AM' UNION ALL

    SELECT '1074345','Mar 4 2014 12:19AM','Mar 4 2014 12:41AM' UNION ALL

    SELECT '1074346','Mar 4 2014 12:29AM','Mar 4 2014 12:41AM' UNION ALL

    SELECT '1074347','Mar 4 2014 12:38AM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074348','Mar 4 2014 12:42AM','Mar 4 2014 12:59AM' UNION ALL

    SELECT '1074349','Mar 4 2014 12:42AM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074350','Mar 4 2014 12:42AM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074351','Mar 4 2014 12:43AM','Mar 4 2014 1:01AM' UNION ALL

    SELECT '1074352','Mar 4 2014 12:59AM','Mar 4 2014 1:59AM' UNION ALL

    SELECT '1074353','Mar 4 2014 12:59AM','Mar 4 2014 1:59AM' UNION ALL

    SELECT '1074354','Mar 4 2014 1:00AM','Mar 4 2014 1:00AM' UNION ALL

    SELECT '1074355','Mar 4 2014 1:00AM','Mar 4 2014 1:31AM' UNION ALL

    SELECT '1074356','Mar 4 2014 1:00AM','Mar 4 2014 2:01AM' UNION ALL

    SELECT '1074357','Mar 4 2014 1:00AM','Mar 4 2014 1:31AM' UNION ALL

    SELECT '1074358','Mar 4 2014 1:00AM','Mar 4 2014 1:59AM' UNION ALL

    SELECT '1074359','Mar 4 2014 1:00AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074360','Mar 4 2014 1:00AM','Mar 4 2014 1:59AM' UNION ALL

    SELECT '1074361','Mar 4 2014 1:00AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074362','Mar 4 2014 1:01AM','Mar 4 2014 1:59AM' UNION ALL

    SELECT '1074363','Mar 4 2014 1:01AM','Mar 4 2014 2:43AM' UNION ALL

    SELECT '1074364','Mar 4 2014 1:01AM','Mar 4 2014 1:59AM' UNION ALL

    SELECT '1074365','Mar 4 2014 1:01AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074366','Mar 4 2014 1:01AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074367','Mar 4 2014 1:01AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074368','Mar 4 2014 1:01AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074369','Mar 4 2014 1:01AM','Mar 4 2014 2:10AM' UNION ALL

    SELECT '1074370','Mar 4 2014 1:01AM','Mar 4 2014 2:10AM' UNION ALL

    SELECT '1074371','Mar 4 2014 1:01AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074372','Mar 4 2014 1:01AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074373','Mar 4 2014 1:01AM','Mar 4 2014 2:10AM' UNION ALL

    SELECT '1074374','Mar 4 2014 1:01AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074375','Mar 4 2014 1:02AM','Mar 4 2014 1:02AM' UNION ALL

    SELECT '1074376','Mar 4 2014 1:02AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074377','Mar 4 2014 1:02AM','Mar 4 2014 3:49AM' UNION ALL

    SELECT '1074378','Mar 4 2014 1:02AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074379','Mar 4 2014 1:02AM','Mar 4 2014 2:02AM' UNION ALL

    SELECT '1074380','Mar 4 2014 1:02AM','Mar 4 2014 2:02AM' UNION ALL

    SELECT '1074381','Mar 4 2014 1:02AM','Mar 4 2014 1:05AM' UNION ALL

    SELECT '1074382','Mar 4 2014 1:03AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074383','Mar 4 2014 1:04AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074384','Mar 4 2014 1:04AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074385','Mar 4 2014 1:05AM','Mar 4 2014 1:06AM' UNION ALL

    SELECT '1074386','Mar 4 2014 1:05AM','Mar 4 2014 3:48AM' UNION ALL

    SELECT '1074387','Mar 4 2014 1:06AM','Mar 4 2014 2:10AM' UNION ALL

    SELECT '1074388','Mar 4 2014 1:06AM','Mar 4 2014 1:10AM' UNION ALL

    SELECT '1074389','Mar 4 2014 1:06AM','Mar 4 2014 3:45AM' UNION ALL

    SELECT '1074390','Mar 4 2014 1:07AM','Mar 4 2014 2:09AM' UNION ALL

    SELECT '1074391','Mar 4 2014 1:07AM','Mar 4 2014 1:55AM' UNION ALL

    SELECT '1074392','Mar 4 2014 1:07AM','Mar 4 2014 3:55AM' UNION ALL

    SELECT '1074393','Mar 4 2014 1:10AM','Mar 4 2014 1:24AM' UNION ALL

    SELECT '1074394','Mar 4 2014 1:10AM','Mar 4 2014 2:43AM' UNION ALL

    SELECT '1074395','Mar 4 2014 1:11AM','Mar 4 2014 2:19AM' UNION ALL

    SELECT '1074396','Mar 4 2014 1:11AM','Mar 4 2014 1:12AM' UNION ALL

    SELECT '1074397','Mar 4 2014 1:12AM','Mar 4 2014 3:56AM' UNION ALL

    SELECT '1074398','Mar 4 2014 1:13AM','Mar 4 2014 2:41AM' UNION ALL

    SELECT '1074399','Mar 4 2014 1:14AM','Mar 4 2014 3:43AM' UNION ALL

    SELECT '1074400','Mar 4 2014 1:15AM','Mar 4 2014 1:16AM' UNION ALL

    SELECT '1074401','Mar 4 2014 1:16AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074402','Mar 4 2014 1:16AM','Mar 4 2014 1:17AM' UNION ALL

    SELECT '1074403','Mar 4 2014 1:16AM','Mar 4 2014 1:18AM' UNION ALL

    SELECT '1074404','Mar 4 2014 1:17AM','Mar 4 2014 2:13AM' UNION ALL

    SELECT '1074405','Mar 4 2014 1:18AM','Mar 4 2014 3:10AM' UNION ALL

    SELECT '1074406','Mar 4 2014 1:19AM','Mar 4 2014 3:44AM' UNION ALL

    SELECT '1074407','Mar 4 2014 1:20AM','Mar 4 2014 1:44AM' UNION ALL

    SELECT '1074408','Mar 4 2014 1:21AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074409','Mar 4 2014 1:21AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074410','Mar 4 2014 1:24AM','Mar 4 2014 1:25AM' UNION ALL

    SELECT '1074411','Mar 4 2014 1:25AM','Mar 4 2014 3:44AM' UNION ALL

    SELECT '1074412','Mar 4 2014 1:27AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074413','Mar 4 2014 1:30AM','Mar 4 2014 2:10AM' UNION ALL

    SELECT '1074414','Mar 4 2014 1:30AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074415','Mar 4 2014 1:31AM','Mar 4 2014 3:08AM' UNION ALL

    SELECT '1074416','Mar 4 2014 1:32AM','Mar 4 2014 2:10AM' UNION ALL

    SELECT '1074417','Mar 4 2014 1:33AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074418','Mar 4 2014 1:35AM','Mar 4 2014 3:06AM' UNION ALL

    SELECT '1074419','Mar 4 2014 1:35AM','Mar 4 2014 2:27AM' UNION ALL

    SELECT '1074420','Mar 4 2014 1:37AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074421','Mar 4 2014 1:55AM','Mar 4 2014 2:00AM' UNION ALL

    SELECT '1074422','Mar 4 2014 1:59AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074423','Mar 4 2014 1:59AM','Mar 4 2014 2:32AM' UNION ALL

    SELECT '1074424','Mar 4 2014 1:59AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074425','Mar 4 2014 1:59AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074426','Mar 4 2014 1:59AM','Mar 4 2014 2:30AM' UNION ALL

    SELECT '1074427','Mar 4 2014 1:59AM','Mar 4 2014 3:33AM' UNION ALL

    SELECT '1074428','Mar 4 2014 1:59AM','Mar 4 2014 3:55AM' UNION ALL

    SELECT '1074429','Mar 4 2014 2:00AM','Mar 4 2014 3:00AM' UNION ALL

    SELECT '1074430','Mar 4 2014 2:00AM','Mar 4 2014 3:43AM' UNION ALL

    SELECT '1074431','Mar 4 2014 2:00AM','Mar 4 2014 2:32AM' UNION ALL

    SELECT '1074432','Mar 4 2014 2:00AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074433','Mar 4 2014 2:00AM','Mar 4 2014 2:32AM' UNION ALL

    SELECT '1074434','Mar 4 2014 2:00AM','Mar 4 2014 2:32AM' UNION ALL

    SELECT '1074435','Mar 4 2014 2:01AM','Mar 4 2014 2:32AM' UNION ALL

    SELECT '1074436','Mar 4 2014 2:01AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074437','Mar 4 2014 2:01AM','Mar 4 2014 2:32AM' UNION ALL

    SELECT '1074438','Mar 4 2014 2:02AM','Mar 4 2014 2:04AM' UNION ALL

    SELECT '1074439','Mar 4 2014 2:02AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074440','Mar 4 2014 2:02AM','Mar 4 2014 4:08AM' UNION ALL

    SELECT '1074441','Mar 4 2014 2:03AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074442','Mar 4 2014 2:03AM','Mar 4 2014 3:55AM' UNION ALL

    SELECT '1074443','Mar 4 2014 2:04AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074444','Mar 4 2014 2:04AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074445','Mar 4 2014 2:04AM','Mar 4 2014 3:33AM' UNION ALL

    SELECT '1074446','Mar 4 2014 2:04AM','Mar 4 2014 4:14AM' UNION ALL

    SELECT '1074447','Mar 4 2014 2:04AM','Mar 4 2014 3:00AM' UNION ALL

    SELECT '1074448','Mar 4 2014 2:05AM','Mar 4 2014 2:36AM' UNION ALL

    SELECT '1074449','Mar 4 2014 2:07AM','Mar 4 2014 3:50AM' UNION ALL

    SELECT '1074450','Mar 4 2014 2:07AM','Mar 4 2014 4:08AM' UNION ALL

    SELECT '1074451','Mar 4 2014 2:08AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074452','Mar 4 2014 2:09AM','Mar 4 2014 2:10AM' UNION ALL

    SELECT '1074453','Mar 4 2014 2:10AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074454','Mar 4 2014 2:10AM','Mar 4 2014 2:50AM' UNION ALL

    SELECT '1074455','Mar 4 2014 2:11AM','Mar 4 2014 3:56AM' UNION ALL

    SELECT '1074456','Mar 4 2014 2:12AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074457','Mar 4 2014 2:12AM','Mar 4 2014 3:56AM' UNION ALL

    SELECT '1074458','Mar 4 2014 2:14AM','Mar 4 2014 2:15AM' UNION ALL

    SELECT '1074459','Mar 4 2014 2:14AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074460','Mar 4 2014 2:22AM','Mar 4 2014 4:15AM' UNION ALL

    SELECT '1074461','Mar 4 2014 2:25AM','Mar 4 2014 3:52AM' UNION ALL

    SELECT '1074462','Mar 4 2014 2:30AM','Mar 4 2014 3:08AM' UNION ALL

    SELECT '1074463','Mar 4 2014 2:33AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074464','Mar 4 2014 2:33AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074465','Mar 4 2014 2:33AM','Mar 4 2014 3:53AM' UNION ALL

    SELECT '1074466','Mar 4 2014 2:34AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074467','Mar 4 2014 2:35AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074468','Mar 4 2014 2:36AM','Mar 4 2014 4:50AM' UNION ALL

    SELECT '1074469','Mar 4 2014 2:36AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074470','Mar 4 2014 2:37AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074471','Mar 4 2014 2:40AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074472','Mar 4 2014 2:42AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074473','Mar 4 2014 2:44AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074474','Mar 4 2014 2:49AM','Mar 4 2014 4:40AM' UNION ALL

    SELECT '1074475','Mar 4 2014 2:59AM','Mar 4 2014 3:58AM' UNION ALL

    SELECT '1074476','Mar 4 2014 3:08AM','Mar 4 2014 3:54AM' UNION ALL

    SELECT '1074477','Mar 4 2014 3:09AM','Mar 4 2014 5:05AM' UNION ALL

    SELECT '1074478','Mar 4 2014 3:11AM','Mar 4 2014 3:53AM' UNION ALL

    SELECT '1074479','Mar 4 2014 3:45AM','Mar 4 2014 4:02AM' UNION ALL

    SELECT '1074480','Mar 4 2014 3:45AM','Mar 4 2014 4:04AM' UNION ALL

    SELECT '1074481','Mar 4 2014 3:46AM','Mar 4 2014 4:06AM' UNION ALL

    SELECT '1074482','Mar 4 2014 3:48AM','Mar 4 2014 4:45AM' UNION ALL

    SELECT '1074483','Mar 4 2014 3:49AM','Mar 4 2014 4:08AM' UNION ALL

    SELECT '1074484','Mar 4 2014 3:50AM','Mar 4 2014 4:06AM' UNION ALL

    SELECT '1074485','Mar 4 2014 3:52AM','Mar 4 2014 4:04AM' UNION ALL

    SELECT '1074486','Mar 4 2014 3:53AM','Mar 4 2014 5:09AM' UNION ALL

    SELECT '1074487','Mar 4 2014 3:53AM','Mar 4 2014 4:00AM' UNION ALL

    SELECT '1074488','Mar 4 2014 3:53AM','Mar 4 2014 5:16AM' UNION ALL

    SELECT '1074489','Mar 4 2014 3:53AM','Mar 4 2014 5:01AM' UNION ALL

    SELECT '1074490','Mar 4 2014 3:53AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074491','Mar 4 2014 3:53AM','Mar 4 2014 3:57AM' UNION ALL

    SELECT '1074492','Mar 4 2014 3:53AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074493','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074494','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074495','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074496','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074497','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074498','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074499','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074500','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074501','Mar 4 2014 3:54AM','Mar 4 2014 5:09AM' UNION ALL

    SELECT '1074502','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074503','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074504','Mar 4 2014 3:54AM','Mar 4 2014 5:16AM' UNION ALL

    SELECT '1074505','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074506','Mar 4 2014 3:54AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074507','Mar 4 2014 3:55AM','Mar 4 2014 5:16AM' UNION ALL

    SELECT '1074508','Mar 4 2014 3:55AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074509','Mar 4 2014 3:55AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074510','Mar 4 2014 3:55AM','Mar 4 2014 4:00AM' UNION ALL

    SELECT '1074511','Mar 4 2014 3:56AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074512','Mar 4 2014 3:56AM','Mar 4 2014 4:00AM' UNION ALL

    SELECT '1074513','Mar 4 2014 3:56AM','Mar 4 2014 5:16AM' UNION ALL

    SELECT '1074514','Mar 4 2014 3:56AM','Mar 4 2014 4:00AM' UNION ALL

    SELECT '1074515','Mar 4 2014 3:57AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074516','Mar 4 2014 3:57AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074517','Mar 4 2014 3:59AM','Mar 4 2014 4:12AM' UNION ALL

    SELECT '1074518','Mar 4 2014 4:04AM','Mar 4 2014 4:15AM' UNION ALL

    SELECT '1074519','Mar 4 2014 4:07AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074520','Mar 4 2014 4:08AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074521','Mar 4 2014 4:16AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074522','Mar 4 2014 4:16AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074523','Mar 4 2014 4:17AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074524','Mar 4 2014 4:17AM','Mar 4 2014 4:58AM' UNION ALL

    SELECT '1074525','Mar 4 2014 4:35AM','Mar 4 2014 4:58AM'

    This is a whole day's worth of sessions. What I'm trying to do is find out if any points in time exist when someone's not in a session; that is, if there's a gap of one minute where there wasn't a session in existence, I need to report it.

    I tried doing a self-join on sessionid = sessionid + 1, but it didn't seem very helpful; since the logoutdatetime of one session can be very far beyond the logindatetime of the next session, it didn't seem like it would return anything necessarily conclusive.

    It feels like I'm missing someone super-obvious here; a push in the right direction would be much appreciated! 😀

    - 😀

  • Is the schedule of sessions relevant? If so, could you post the DDL for the create/insert statements?

    You might want to search for Itzik Ben-Gan's "Gaps and Islands" solutions. (His book on windowing functions in 2012 is really good, but you're using 2008, right?)

  • Nope, scheduling doesn't matter; if a gap in time exists anywhere, it needs to be reported. If a session starts as the first session of the day, and it runs until the end of the day, we didn't have an outage regardless of how all the other sessions went.

    I'll certainly look into Ben-Gan's solutions to this as well; I own one of his books, and it may well be part of the text (and if not, I owe it a good reading anyhow!). Oh, and yes, it's a 2008 server.

    - 😀

  • Here's an option you could explore. The range used works for almost 7 days.

    The problem is that a gap between 2 Sessions can be covered by another one, so I built a timetable on the fly to check for available times.

    WITH e1(N) AS(

    SELECT N FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))e(N) -- 10 rows

    ),

    e2(N) AS(

    SELECT a.N FROM e1 a, e1 b --10 x 10 = 100 rows

    ),

    e4(N) AS(

    SELECT a.N FROM e2 a, e2 b --100 x 100 = 10,000 rows (I hope it's enough)

    ),

    cteTally(N) AS(

    SELECT TOP(SELECT DATEDIFF( MI, MIN(Logindatetime), MAX(Logoutdatetime)) + 1 FROM #SessionTest) --Get the range

    DATEADD( MI, ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) - 1, (SELECT MIN(Logindatetime) FROM #SessionTest) /*Get the starting point*/) N

    FROM e4

    ),

    Gaps AS(

    SELECT N, DATEADD(MI, - ROW_NUMBER() OVER (ORDER BY N), N) DateGroup

    FROM cteTally t

    WHERE NOT EXISTS( SELECT 1 FROM #SessionTest s

    WHERE N BETWEEN s.Logindatetime AND s.Logoutdatetime)

    )

    SELECT MIN(N) StartDate, MAX(N) EndDate, COUNT(*) FreeMinutes

    FROM Gaps

    GROUP BY DateGroup

    ORDER BY StartDate

    It uses an Islands technique explained in this article, but changed to use minutes instead of days.

    http://www.sqlservercentral.com/articles/T-SQL/71550/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Aha! Did a quick test on my home instance, and that seems to do it. I'll investigate more when I'm back at work tomorrow and have more data in front of me. The tally table solution really should've been obvious to me; I've done it before with ranges of dates, and I should've realized I could just change the increments to minutes instead.

    Thanks a ton for the help! I think this should handle things 😀

    - 😀

  • Perhaps this article will be what you need:

    Calculating Gaps Between Overlapping Time Intervals in SQL[/url]


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St

  • Whew. Managed to get some testing done, and Luis's solution certainly worked out. Played around with the code and verified results for a month's worth of data, then made adjustments to filter out certain logins (supervisors, who log in and out much earlier than regular users), and expanded the detection interval to 5 minutes from 1 minute by user request.

    I've got a lot of reading to do, with both that Spackle article and Dwain's excellent writeup on the subject, though! Thanks a lot for the help and reading material; I need to learn how to do this on command (or at least mostly on command) in the future, for certain.

    - 😀

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply