<?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: Comparing dates without times in SQL Server</title>
	<atom:link href="http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/</link>
	<description>Web development notes and commentary from Ryan Stille</description>
	<lastBuildDate>Wed, 01 Feb 2012 10:14:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Ryan</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-2598</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 03 Nov 2011 12:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-2598</guid>
		<description>Kenny, thanks for the comment. The &#039;date&#039; type was only added in SQL Server 2008. In all the prior versions you&#039;ll need to do some mangling to be able to compare just the date portion.</description>
		<content:encoded><![CDATA[<p>Kenny, thanks for the comment. The &#8216;date&#8217; type was only added in SQL Server 2008. In all the prior versions you&#8217;ll need to do some mangling to be able to compare just the date portion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kenny</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-2597</link>
		<dc:creator>kenny</dc:creator>
		<pubDate>Thu, 03 Nov 2011 09:34:54 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-2597</guid>
		<description>What&#039;s wrong with:
select cast(datetimefield as date) ?

Why go the hard way?
I tried it, and just casting to date type works, no floor, floats, .. involved..</description>
		<content:encoded><![CDATA[<p>What&#8217;s wrong with:<br />
select cast(datetimefield as date) ?</p>
<p>Why go the hard way?<br />
I tried it, and just casting to date type works, no floor, floats, .. involved..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankur</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-2530</link>
		<dc:creator>Ankur</dc:creator>
		<pubDate>Sat, 24 Sep 2011 13:09:36 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-2530</guid>
		<description>SELECT * FROM TableName WHERE DATEPART(DY,Date) = DATEPART(DY,@date)</description>
		<content:encoded><![CDATA[<p>SELECT * FROM TableName WHERE DATEPART(DY,Date) = DATEPART(DY,@date)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Javier</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-2185</link>
		<dc:creator>Javier</dc:creator>
		<pubDate>Tue, 12 Apr 2011 21:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-2185</guid>
		<description>This is the best way by far:

DateAdd(day, datediff(day,0, MydateValue), 0) 

See the complete article on : http://stackoverflow.com/questions/353014/convert-sql-server-datetime-fields-to-compare-date-parts-only-with-indexed-looku</description>
		<content:encoded><![CDATA[<p>This is the best way by far:</p>
<p>DateAdd(day, datediff(day,0, MydateValue), 0) </p>
<p>See the complete article on : <a href="http://stackoverflow.com/questions/353014/convert-sql-server-datetime-fields-to-compare-date-parts-only-with-indexed-looku" rel="nofollow">http://stackoverflow.com/questions/353014/convert-sql-server-datetime-fields-to-compare-date-parts-only-with-indexed-looku</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Faheem Ahmad</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-2182</link>
		<dc:creator>Faheem Ahmad</dc:creator>
		<pubDate>Tue, 12 Apr 2011 08:00:24 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-2182</guid>
		<description>Great article.
I tested with following example and it really works for me.

DECLARE @d1 SMALLDATETIME
DECLARE @d2 SMALLDATETIME

SET @d1 = (SELECT CAST(FLOOR(CAST( GETUTCDATE() AS float)) AS datetime))
SET @d2 = (SELECT CAST(FLOOR(CAST( GETDATE() AS float)) AS datetime))

--PRINT @d3
--PRINT @d4

IF(@d1 = @d2)
&#160;&#160;&#160;&#160;PRINT &apos;both dates are equal&apos;
ELSE
&#160;&#160;&#160;&#160;PRINT &apos;no both dates are different&apos;
&#160;&#160;&#160;&#160;
Thanks dude.</description>
		<content:encoded><![CDATA[<p>Great article.<br />
I tested with following example and it really works for me.</p>
<p>DECLARE @d1 SMALLDATETIME<br />
DECLARE @d2 SMALLDATETIME</p>
<p>SET @d1 = (SELECT CAST(FLOOR(CAST( GETUTCDATE() AS float)) AS datetime))<br />
SET @d2 = (SELECT CAST(FLOOR(CAST( GETDATE() AS float)) AS datetime))</p>
<p>&#8211;PRINT @d3<br />
&#8211;PRINT @d4</p>
<p>IF(@d1 = @d2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;PRINT &apos;both dates are equal&apos;<br />
ELSE<br />
&nbsp;&nbsp;&nbsp;&nbsp;PRINT &apos;no both dates are different&apos;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
Thanks dude.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manoj</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-1565</link>
		<dc:creator>Manoj</dc:creator>
		<pubDate>Sun, 25 Jul 2010 14:00:49 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-1565</guid>
		<description>can we able to compare two dates by using if condition</description>
		<content:encoded><![CDATA[<p>can we able to compare two dates by using if condition</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Claes</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-685</link>
		<dc:creator>Claes</dc:creator>
		<pubDate>Tue, 25 Aug 2009 09:13:39 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-685</guid>
		<description>If you compare two datetime fields in this way, the cast back to datetime should not be necessary. This saves some execution time.</description>
		<content:encoded><![CDATA[<p>If you compare two datetime fields in this way, the cast back to datetime should not be necessary. This saves some execution time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blerta</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-588</link>
		<dc:creator>Blerta</dc:creator>
		<pubDate>Fri, 31 Jul 2009 11:52:19 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-588</guid>
		<description>Great article and big help. Thank you!</description>
		<content:encoded><![CDATA[<p>Great article and big help. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marianne</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-95</link>
		<dc:creator>Marianne</dc:creator>
		<pubDate>Tue, 09 Jun 2009 19:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-95</guid>
		<description>Thank you! This was exactly what I needed :)</description>
		<content:encoded><![CDATA[<p>Thank you! This was exactly what I needed <img src='http://www.stillnetstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Jibben</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-101</link>
		<dc:creator>Scott Jibben</dc:creator>
		<pubDate>Thu, 04 Jun 2009 20:18:47 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-101</guid>
		<description>This web editor converted the 8, followed by a right parenthesis into a smiley face...</description>
		<content:encoded><![CDATA[<p>This web editor converted the 8, followed by a right parenthesis into a smiley face&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

