<?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>Fri, 12 Mar 2010 05:05:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>
	<item>
		<title>By: Scott Jibben</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-97</link>
		<dc:creator>Scott Jibben</dc:creator>
		<pubDate>Thu, 04 Jun 2009 20:16:51 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-97</guid>
		<description>If you want just the time portion from a datetime column, read the information on the CONVERT() function in the docs for more info.

(12 hour)

SELECT CONVERT(varchar(12), myDateField, 8) FROM myTable;

or (24 hour)

SELECT CONVERT(varchar(12), myDateField, 14) FROM myTable;</description>
		<content:encoded><![CDATA[<p>If you want just the time portion from a datetime column, read the information on the CONVERT() function in the docs for more info.</p>
<p>(12 hour)</p>
<p>SELECT CONVERT(varchar(12), myDateField, <img src='http://www.stillnetstudios.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> FROM myTable;</p>
<p>or (24 hour)</p>
<p>SELECT CONVERT(varchar(12), myDateField, 14) FROM myTable;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john persona</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-94</link>
		<dc:creator>john persona</dc:creator>
		<pubDate>Tue, 12 May 2009 06:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-94</guid>
		<description>great article, but it does not explain how to get only time portion from full date.</description>
		<content:encoded><![CDATA[<p>great article, but it does not explain how to get only time portion from full date.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Schier</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-100</link>
		<dc:creator>Justin Schier</dc:creator>
		<pubDate>Sun, 10 May 2009 18:58:45 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-100</guid>
		<description>In the above code, the dashes should be double dashes. This website changed them to long dashes.</description>
		<content:encoded><![CDATA[<p>In the above code, the dashes should be double dashes. This website changed them to long dashes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Schier</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-99</link>
		<dc:creator>Justin Schier</dc:creator>
		<pubDate>Sun, 10 May 2009 18:57:02 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-99</guid>
		<description>I made a function that I use called WholeDay() so you can just wrap any date in WholeDay(DATE_COLUMN). This is SQL Server, and I always have to use dbo.WholeDay(DATE_COLUMN)

Here&#039;s the function:

/****** Object:&#160;&#160;UserDefinedFunction [dbo].[WholeDay]&#160;&#160;&#160;&#160;Script Date: 05/10/2009 11:55:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Justin Schier
-- Create date: 4/9/2008
-- Description:&#160;&#160;&#160;&#160;Drops Time from DateTime
-- =============================================
CREATE FUNCTION [dbo].[WholeDay]
(
&#160;&#160;&#160;&#160;-- Add the parameters for the function here
&#160;&#160;&#160;&#160;@p1 datetime
)
RETURNS datetime
AS
BEGIN
&#160;&#160;&#160;&#160;-- Declare the return variable here
&#160;&#160;&#160;&#160;DECLARE @Result datetime

&#160;&#160;&#160;&#160;-- Add the T-SQL statements to compute the return value here
&#160;&#160;&#160;&#160;SELECT @Result = CAST(FLOOR(CAST(@p1 AS FLOAT)) AS DATETIME)

&#160;&#160;&#160;&#160;-- Return the result of the function
&#160;&#160;&#160;&#160;RETURN @Result

END</description>
		<content:encoded><![CDATA[<p>I made a function that I use called WholeDay() so you can just wrap any date in WholeDay(DATE_COLUMN). This is SQL Server, and I always have to use dbo.WholeDay(DATE_COLUMN)</p>
<p>Here&#039;s the function:</p>
<p>/****** Object:&nbsp;&nbsp;UserDefinedFunction [dbo].[WholeDay]&nbsp;&nbsp;&nbsp;&nbsp;Script Date: 05/10/2009 11:55:50 ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
&#8211; =============================================<br />
&#8211; Author:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Justin Schier<br />
&#8211; Create date: 4/9/2008<br />
&#8211; Description:&nbsp;&nbsp;&nbsp;&nbsp;Drops Time from DateTime<br />
&#8211; =============================================<br />
CREATE FUNCTION [dbo].[WholeDay]<br />
(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8211; Add the parameters for the function here<br />
&nbsp;&nbsp;&nbsp;&nbsp;@p1 datetime<br />
)<br />
RETURNS datetime<br />
AS<br />
BEGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8211; Declare the return variable here<br />
&nbsp;&nbsp;&nbsp;&nbsp;DECLARE @Result datetime</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&#8211; Add the T-SQL statements to compute the return value here<br />
&nbsp;&nbsp;&nbsp;&nbsp;SELECT @Result = CAST(FLOOR(CAST(@p1 AS FLOAT)) AS DATETIME)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&#8211; Return the result of the function<br />
&nbsp;&nbsp;&nbsp;&nbsp;RETURN @Result</p>
<p>END</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ting</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-98</link>
		<dc:creator>Ting</dc:creator>
		<pubDate>Fri, 08 May 2009 18:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-98</guid>
		<description>Great aritcle! That&#039;s exactly I was looking for!

Thanks! :)</description>
		<content:encoded><![CDATA[<p>Great aritcle! That&#039;s exactly I was looking for!</p>
<p>Thanks! <img src='http://www.stillnetstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/comment-page-1/#comment-103</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Wed, 11 Feb 2009 09:46:06 +0000</pubDate>
		<guid isPermaLink="false">http://ryan.cfwebtools.com/2007/01/20/comparing-dates-without-times-in-sql-server/#comment-103</guid>
		<description>Another cool way a friend showed me of doing this is ...

SELECT CONVERT(DATETIME,CONVERT(VARCHAR(12), GETDATE(), 105))

... I think you can get the different codes (e.g. 105) in the msdn cast/convert section.

I like the first solution though. Shows how many tricks can be learned in sql :)</description>
		<content:encoded><![CDATA[<p>Another cool way a friend showed me of doing this is &#8230;</p>
<p>SELECT CONVERT(DATETIME,CONVERT(VARCHAR(12), GETDATE(), 105))</p>
<p>&#8230; I think you can get the different codes (e.g. 105) in the msdn cast/convert section.</p>
<p>I like the first solution though. Shows how many tricks can be learned in sql <img src='http://www.stillnetstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
