<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments for Where's the peanut butter?!</title>
	<link>http://www.masivp.com/wordpress</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Sun, 12 Oct 2008 16:56:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>Comment on SQL time aggregate functions by Scott Sorheim</title>
		<link>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-485</link>
		<author>Scott Sorheim</author>
		<pubDate>Thu, 02 Oct 2008 17:57:44 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-485</guid>
		<description>Wow, this is really the last thing I needed to get distracted by today, but for some reason I couldn't resist.  I set up a basic table the had StartDate and EndDate columns.  I pumped in a few lines of sample data, then, I created this query:

SELECT MinStart, MaxEnd FROM (
SELECT TOP 100 PERCENT 
	COALESCE((
		SELECT min(StartDate)
		FROM EmpTimes b
		WHERE a.StartDate between b.StartDate and b.EndDate
		), 0
	) AS MinStart,
	COALESCE((
		SELECT max(enddate)
		FROM EmpTimes b
		WHERE a.EndDate between b.StartDate and b.EndDate
		), 0
	) AS MaxEnd
FROM EmpTimes a
ORDER BY StartDate, EndDate
) AS T1
GROUP BY MinStart, MaxEnd

Which, for my small set of data anyway, groups all of the overlapping chunks of time.  I got something like this:

MinStart &#124; MaxEnd
2008-10-01 09:00:00.000 &#124; 2008-10-01 17:00:00.000
2008-10-01 18:00:00.000 &#124; 2008-10-01 19:00:00.000
2008-10-01 19:30:00.000 &#124; 2008-10-01 22:00:00.000

From here on out, the only work left would be to sum the minutes from those blocks of time.

Is there a prize?!  There's probably an easier way, but that was my first shot and it worked.</description>
		<content:encoded><![CDATA[<p>Wow, this is really the last thing I needed to get distracted by today, but for some reason I couldn&#8217;t resist.  I set up a basic table the had StartDate and EndDate columns.  I pumped in a few lines of sample data, then, I created this query:</p>
<p>SELECT MinStart, MaxEnd FROM (<br />
SELECT TOP 100 PERCENT<br />
	COALESCE((<br />
		SELECT min(StartDate)<br />
		FROM EmpTimes b<br />
		WHERE a.StartDate between b.StartDate and b.EndDate<br />
		), 0<br />
	) AS MinStart,<br />
	COALESCE((<br />
		SELECT max(enddate)<br />
		FROM EmpTimes b<br />
		WHERE a.EndDate between b.StartDate and b.EndDate<br />
		), 0<br />
	) AS MaxEnd<br />
FROM EmpTimes a<br />
ORDER BY StartDate, EndDate<br />
) AS T1<br />
GROUP BY MinStart, MaxEnd</p>
<p>Which, for my small set of data anyway, groups all of the overlapping chunks of time.  I got something like this:</p>
<p>MinStart | MaxEnd<br />
2008-10-01 09:00:00.000 | 2008-10-01 17:00:00.000<br />
2008-10-01 18:00:00.000 | 2008-10-01 19:00:00.000<br />
2008-10-01 19:30:00.000 | 2008-10-01 22:00:00.000</p>
<p>From here on out, the only work left would be to sum the minutes from those blocks of time.</p>
<p>Is there a prize?!  There&#8217;s probably an easier way, but that was my first shot and it worked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on For sale by Patrick</title>
		<link>http://www.masivp.com/wordpress/2008/10/01/for-sale-2/#comment-484</link>
		<author>Patrick</author>
		<pubDate>Thu, 02 Oct 2008 16:38:53 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/10/01/for-sale-2/#comment-484</guid>
		<description>Thanks! I sure hope so. Yeah - I think the agent made some great choices that have helped emphasize all the best characteristics.</description>
		<content:encoded><![CDATA[<p>Thanks! I sure hope so. Yeah - I think the agent made some great choices that have helped emphasize all the best characteristics.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on For sale by Eva</title>
		<link>http://www.masivp.com/wordpress/2008/10/01/for-sale-2/#comment-483</link>
		<author>Eva</author>
		<pubDate>Thu, 02 Oct 2008 16:32:58 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/10/01/for-sale-2/#comment-483</guid>
		<description>Wow, great listing! The staging and photography are great. I'm sure you'll have an offer before you know it.</description>
		<content:encoded><![CDATA[<p>Wow, great listing! The staging and photography are great. I&#8217;m sure you&#8217;ll have an offer before you know it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ozzy had nothing on Sarah Palin by rolando</title>
		<link>http://www.masivp.com/wordpress/2008/09/25/ozzy-had-nothing-on-sarah-palin/#comment-482</link>
		<author>rolando</author>
		<pubDate>Thu, 25 Sep 2008 20:04:16 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/09/25/ozzy-had-nothing-on-sarah-palin/#comment-482</guid>
		<description>saw this last night. 12 kinds of awesome. this campaign can't shit on itself fast enough can it? lookin forward to next week's veep debate, for entertainment purposes if nothing else. palin already looks a little over the whole VP thing, if recent interviews with her are any indication.</description>
		<content:encoded><![CDATA[<p>saw this last night. 12 kinds of awesome. this campaign can&#8217;t shit on itself fast enough can it? lookin forward to next week&#8217;s veep debate, for entertainment purposes if nothing else. palin already looks a little over the whole VP thing, if recent interviews with her are any indication.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SQL time aggregate functions by Patrick</title>
		<link>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-481</link>
		<author>Patrick</author>
		<pubDate>Fri, 12 Sep 2008 18:45:21 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-481</guid>
		<description>Why would I send a &#60;pre&#62; tag to do a  &#60;th&#62;'s job?</description>
		<content:encoded><![CDATA[<p>Why would I send a &lt;pre&gt; tag to do a  &lt;th&gt;&#8217;s job?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SQL time aggregate functions by rolando</title>
		<link>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-480</link>
		<author>rolando</author>
		<pubDate>Fri, 12 Sep 2008 18:41:54 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-480</guid>
		<description>pre tag damnit!</description>
		<content:encoded><![CDATA[<p>pre tag damnit!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SQL time aggregate functions by rolando</title>
		<link>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-479</link>
		<author>rolando</author>
		<pubDate>Fri, 12 Sep 2008 18:41:34 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-479</guid>
		<description>ahh, you improved it since i posted...and your comment thing erased my  tag</description>
		<content:encoded><![CDATA[<p>ahh, you improved it since i posted&#8230;and your comment thing erased my  tag</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SQL time aggregate functions by rolando</title>
		<link>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-478</link>
		<author>rolando</author>
		<pubDate>Fri, 12 Sep 2008 18:40:40 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/09/12/sql-time-aggregate-functions/#comment-478</guid>
		<description>i think before you solve this brain buster you should learn about  tags, Confusion McSloppyTable.</description>
		<content:encoded><![CDATA[<p>i think before you solve this brain buster you should learn about  tags, Confusion McSloppyTable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on God&#8217;s will? by Moshe</title>
		<link>http://www.masivp.com/wordpress/2008/09/04/gods-will/#comment-476</link>
		<author>Moshe</author>
		<pubDate>Thu, 04 Sep 2008 17:49:26 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/09/04/gods-will/#comment-476</guid>
		<description>So did His plan change (a flipflopper!?) or is the natural gas pipeline somehow a part of the same plan as invading Iraq? (her quotes don't say "one of God's wills").

While looking up the quotes, I also found that apparently she was a member of the pro-secessionist Alaskan Independence Party (and continues to support it as shown by giving a welcoming address for their convention this year).  I'm not going to argue that the thought of secession is a crazy idea given the past few years (aside: how many Olympic medals would Alaska have gotten in Bejing?), but it is an odd one to support in a presidential/VP candidate.</description>
		<content:encoded><![CDATA[<p>So did His plan change (a flipflopper!?) or is the natural gas pipeline somehow a part of the same plan as invading Iraq? (her quotes don&#8217;t say &#8220;one of God&#8217;s wills&#8221;).</p>
<p>While looking up the quotes, I also found that apparently she was a member of the pro-secessionist Alaskan Independence Party (and continues to support it as shown by giving a welcoming address for their convention this year).  I&#8217;m not going to argue that the thought of secession is a crazy idea given the past few years (aside: how many Olympic medals would Alaska have gotten in Bejing?), but it is an odd one to support in a presidential/VP candidate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Jacuzzi vs. Hot Tub by Patrick</title>
		<link>http://www.masivp.com/wordpress/2008/08/26/jacuzzi-vs-hot-tub/#comment-473</link>
		<author>Patrick</author>
		<pubDate>Tue, 26 Aug 2008 22:31:28 +0000</pubDate>
		<guid>http://www.masivp.com/wordpress/2008/08/26/jacuzzi-vs-hot-tub/#comment-473</guid>
		<description>Ha ha ha ha ha :)</description>
		<content:encoded><![CDATA[<p>Ha ha ha ha ha <img src='http://www.masivp.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
