<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: DateTime comparisons in SQL Server 2007</title>
	<atom:link href="http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm/feed" rel="self" type="application/rss+xml" />
	<link>http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm</link>
	<description>We know accurately only when we know little, with knowledge doubt increases.  (Goethe)</description>
	<lastBuildDate>Mon, 06 Feb 2012 12:46:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Christian Donner</title>
		<link>http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm/comment-page-1#comment-4306</link>
		<dc:creator>Christian Donner</dc:creator>
		<pubDate>Thu, 19 Feb 2009 23:03:38 +0000</pubDate>
		<guid isPermaLink="false">http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm#comment-4306</guid>
		<description>Yes, I made a mistake 8 months ago, and nobody else seems to have read the posting since then, because nobody pointed out the mistake. I did not reread it when I posted the link on SO. That&#039;s why peer-reviewed sites like SO are great. Again, I appreciate the opportunity to correct myself. Now please get over it.</description>
		<content:encoded><![CDATA[<p>Yes, I made a mistake 8 months ago, and nobody else seems to have read the posting since then, because nobody pointed out the mistake. I did not reread it when I posted the link on SO. That&#8217;s why peer-reviewed sites like SO are great. Again, I appreciate the opportunity to correct myself. Now please get over it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Brady</title>
		<link>http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm/comment-page-1#comment-4300</link>
		<dc:creator>Mark Brady</dc:creator>
		<pubDate>Mon, 16 Feb 2009 20:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm#comment-4300</guid>
		<description>It&#039;s disingenuous to say you wrote this deliriously. You quoted yourself 6 months later on Stack Overflow. This wasn&#039;t something I pointed out the following day and you fixed. You wrote this in August and referenced yourself in February. You&#039;ve believed this was true for 6 months. 

It&#039;s also disingenuous to say you appreciate me pointing it out. When I added a comment to your answer on SO (that seems to be deleted) you defended yourself and told me that I should &quot;know what I&#039;m talking about before accusing you of being wrong&quot;. Even when someone tried to point out the error you were defending it, and you weren&#039;t open to correction.

All I&#039;m asking is before you post things, in multiple locations, that you understand what it is you&#039;re posting. We need less disinformation not more.</description>
		<content:encoded><![CDATA[<p>It&#8217;s disingenuous to say you wrote this deliriously. You quoted yourself 6 months later on Stack Overflow. This wasn&#8217;t something I pointed out the following day and you fixed. You wrote this in August and referenced yourself in February. You&#8217;ve believed this was true for 6 months. </p>
<p>It&#8217;s also disingenuous to say you appreciate me pointing it out. When I added a comment to your answer on SO (that seems to be deleted) you defended yourself and told me that I should &#8220;know what I&#8217;m talking about before accusing you of being wrong&#8221;. Even when someone tried to point out the error you were defending it, and you weren&#8217;t open to correction.</p>
<p>All I&#8217;m asking is before you post things, in multiple locations, that you understand what it is you&#8217;re posting. We need less disinformation not more.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Donner</title>
		<link>http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm/comment-page-1#comment-4292</link>
		<dc:creator>Christian Donner</dc:creator>
		<pubDate>Sat, 14 Feb 2009 01:42:23 +0000</pubDate>
		<guid isPermaLink="false">http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm#comment-4292</guid>
		<description>&lt;p&gt;No, I am not basing editorial decisions on reading speed. I am basing my openess to criticism on the probability that you actually read the post.&lt;br /&gt;
That said, and after looking at it myself, I have to admit that I must have been delirious when I wrote it. I appreciate that you pointed this out to me. I do not appreciate the way you did it, though. 
Either way, I will rewrite it when I am back from vacation, or whenever I get to it.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>No, I am not basing editorial decisions on reading speed. I am basing my openess to criticism on the probability that you actually read the post.<br />
That said, and after looking at it myself, I have to admit that I must have been delirious when I wrote it. I appreciate that you pointed this out to me. I do not appreciate the way you did it, though.<br />
Either way, I will rewrite it when I am back from vacation, or whenever I get to it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Brady</title>
		<link>http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm/comment-page-1#comment-4291</link>
		<dc:creator>Mark Brady</dc:creator>
		<pubDate>Fri, 13 Feb 2009 22:29:53 +0000</pubDate>
		<guid isPermaLink="false">http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm#comment-4291</guid>
		<description>I&#039;m unsure what you mean. I couldn&#039;t possible have read ... You&#039;re basing your editorial decisions on reading speed? That&#039;s a cop-out. </description>
		<content:encoded><![CDATA[<p>I&#8217;m unsure what you mean. I couldn&#8217;t possible have read &#8230; You&#8217;re basing your editorial decisions on reading speed? That&#8217;s a cop-out. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Donner</title>
		<link>http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm/comment-page-1#comment-4289</link>
		<dc:creator>Christian Donner</dc:creator>
		<pubDate>Fri, 13 Feb 2009 21:26:58 +0000</pubDate>
		<guid isPermaLink="false">http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm#comment-4289</guid>
		<description>&lt;p&gt;Mark,&lt;br /&gt;I did not approve your other comment. You cannot possibly have read the post in the time since I commented on Stackoverflow.com.&lt;br /&gt;&lt;br /&gt;I used the strings for illustration purposes, which I realize may not have been the smartest thing. It does not change the underlying issue.&lt;br /&gt; &lt;br /&gt;Please read up on &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa175784(SQL.80).aspx&quot; rel=&quot;nofollow&quot;&gt;the topic&lt;/a&gt; before you insult people.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Mark,<br />I did not approve your other comment. You cannot possibly have read the post in the time since I commented on Stackoverflow.com.</p>
<p>I used the strings for illustration purposes, which I realize may not have been the smartest thing. It does not change the underlying issue.<br /> <br />Please read up on <a href="http://msdn.microsoft.com/en-us/library/aa175784(SQL.80).aspx" rel="nofollow">the topic</a> before you insult people.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Brady</title>
		<link>http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm/comment-page-1#comment-4287</link>
		<dc:creator>Mark Brady</dc:creator>
		<pubDate>Fri, 13 Feb 2009 21:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://cdonner.com/why-not-to-use-between-for-datetime-comparisons-in-sql-server-2007.htm#comment-4287</guid>
		<description>You&#039;re not working with dates. &#039;01/01/08&#039; isn&#039;t a date. Not to any computer functioning. It&#039;s a string.Take your second query and replace it with real dates and it works fine.DECLARE @Jan108 datetimeDECLARE @Feb108 datetimeDECLARE @Dec3107 datetime
SET @Jan108 = &#039;1/1/08&#039;SET @Feb108 = &#039;2/1/08&#039;SET @Dec3107 = &#039;12/31/07&#039;
select case when @Jan108 between @Jan108 and @Feb108 then &#039;in&#039; else &#039;out&#039; end as s1,
 case when @Jan108 between @Dec3107 and @Jan108 then &#039;in&#039; else &#039;out&#039; end as s2

 

</description>
		<content:encoded><![CDATA[<p>You&#8217;re not working with dates. &#8217;01/01/08&#8242; isn&#8217;t a date. Not to any computer functioning. It&#8217;s a string.Take your second query and replace it with real dates and it works fine.DECLARE @Jan108 datetimeDECLARE @Feb108 datetimeDECLARE @Dec3107 datetime<br />
SET @Jan108 = &#8217;1/1/08&#8242;SET @Feb108 = &#8217;2/1/08&#8242;SET @Dec3107 = &#8217;12/31/07&#8242;<br />
select case when @Jan108 between @Jan108 and @Feb108 then &#8216;in&#8217; else &#8216;out&#8217; end as s1,<br />
 case when @Jan108 between @Dec3107 and @Jan108 then &#8216;in&#8217; else &#8216;out&#8217; end as s2</p>
<p> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

