<?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: Trunc Date in SQL Server</title>
	<atom:link href="http://sqlserverplanet.com/oracleequivalents/trunc-date-sql-server/feed" rel="self" type="application/rss+xml" />
	<link>http://sqlserverplanet.com/oracleequivalents/trunc-date-sql-server</link>
	<description>Tips and Articles on SQL Server</description>
	<lastBuildDate>Wed, 16 May 2012 18:08:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Derek Dieter</title>
		<link>http://sqlserverplanet.com/oracleequivalents/trunc-date-sql-server/comment-page-1#comment-756</link>
		<dc:creator>Derek Dieter</dc:creator>
		<pubDate>Sat, 13 Aug 2011 05:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1606#comment-756</guid>
		<description>Thank you John,

I did know about the new date only feature but needed to update this article accordingly.  Thanks, it is much easier to read.

Derek</description>
		<content:encoded><![CDATA[<p>Thank you John,</p>
<p>I did know about the new date only feature but needed to update this article accordingly.  Thanks, it is much easier to read.</p>
<p>Derek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JohnNeville</title>
		<link>http://sqlserverplanet.com/oracleequivalents/trunc-date-sql-server/comment-page-1#comment-737</link>
		<dc:creator>JohnNeville</dc:creator>
		<pubDate>Tue, 02 Aug 2011 15:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1606#comment-737</guid>
		<description>From SS2008 onwards you can use the &#039;date&#039; datatype.

SELECT Cast(GetDate() AS date);
-- works fine, as does

DECLARE @dateonly date = GetDate();
SELECT @dateonly;

I find the above much easier to read in code.

HTH</description>
		<content:encoded><![CDATA[<p>From SS2008 onwards you can use the &#8216;date&#8217; datatype.</p>
<p>SELECT Cast(GetDate() AS date);<br />
&#8211; works fine, as does</p>
<p>DECLARE @dateonly date = GetDate();<br />
SELECT @dateonly;</p>
<p>I find the above much easier to read in code.</p>
<p>HTH</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fotis</title>
		<link>http://sqlserverplanet.com/oracleequivalents/trunc-date-sql-server/comment-page-1#comment-508</link>
		<dc:creator>fotis</dc:creator>
		<pubDate>Fri, 25 Feb 2011 11:37:58 +0000</pubDate>
		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1606#comment-508</guid>
		<description>a diferent approach:

create FUNCTION [dbo].[TimeOnly] ( @DateTime DATETIME )
RETURNS DATETIME
AS BEGIN
    RETURN DATEADD(day, -DATEDIFF(day, 0, @datetime), @datetime)
   END
GO

CREATE  FUNCTION [dbo].[DateOnly] ( @DateTime DATETIME )
RETURNS DATETIME
AS BEGIN
    RETURN DATEADD(dd, 0, DATEDIFF(dd, 0, @DateTime))
   END

GO</description>
		<content:encoded><![CDATA[<p>a diferent approach:</p>
<p>create FUNCTION [dbo].[TimeOnly] ( @DateTime DATETIME )<br />
RETURNS DATETIME<br />
AS BEGIN<br />
    RETURN DATEADD(day, -DATEDIFF(day, 0, @datetime), @datetime)<br />
   END<br />
GO</p>
<p>CREATE  FUNCTION [dbo].[DateOnly] ( @DateTime DATETIME )<br />
RETURNS DATETIME<br />
AS BEGIN<br />
    RETURN DATEADD(dd, 0, DATEDIFF(dd, 0, @DateTime))<br />
   END</p>
<p>GO</p>
]]></content:encoded>
	</item>
</channel>
</rss>

