<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Retrieve &#8211; Select Only Date Part From DateTime &#8211; Best Practice</title>
	<atom:link href="http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 10 Feb 2012 04:35:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Raj</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-249494</link>
		<dc:creator><![CDATA[Raj]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 11:22:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-249494</guid>
		<description><![CDATA[Thnks a ton]]></description>
		<content:encoded><![CDATA[<p>Thnks a ton</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vishvas</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-244434</link>
		<dc:creator><![CDATA[Vishvas]]></dc:creator>
		<pubDate>Fri, 27 Jan 2012 08:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-244434</guid>
		<description><![CDATA[Hi i have a issue can you please help.

I have 35 K records (email address) i need to pull out only the domain part (after @) and update to another column.

How to do this?]]></description>
		<content:encoded><![CDATA[<p>Hi i have a issue can you please help.</p>
<p>I have 35 K records (email address) i need to pull out only the domain part (after @) and update to another column.</p>
<p>How to do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: venkat</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-240106</link>
		<dc:creator><![CDATA[venkat]]></dc:creator>
		<pubDate>Wed, 18 Jan 2012 09:30:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-240106</guid>
		<description><![CDATA[how i select date value from sql?. I used ms acces i used &#039; datevalue&#039; key word. but in sql &#039;to_date&#039; key word is not working. any one please help me?. How i retrieve a date value in sql through java?. Please help me.]]></description>
		<content:encoded><![CDATA[<p>how i select date value from sql?. I used ms acces i used &#8216; datevalue&#8217; key word. but in sql &#8216;to_date&#8217; key word is not working. any one please help me?. How i retrieve a date value in sql through java?. Please help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: usanj34</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-233360</link>
		<dc:creator><![CDATA[usanj34]]></dc:creator>
		<pubDate>Sun, 08 Jan 2012 05:27:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-233360</guid>
		<description><![CDATA[i got it.]]></description>
		<content:encoded><![CDATA[<p>i got it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: usanj34</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-233343</link>
		<dc:creator><![CDATA[usanj34]]></dc:creator>
		<pubDate>Sun, 08 Jan 2012 04:50:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-233343</guid>
		<description><![CDATA[hi can someone help me get date values in my table 
i inserted 10-mar-05 but system gave me 1900-01-03

Thanks]]></description>
		<content:encoded><![CDATA[<p>hi can someone help me get date values in my table<br />
i inserted 10-mar-05 but system gave me 1900-01-03</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-231186</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 11:03:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-231186</guid>
		<description><![CDATA[What is the dateformat? Depending on it you can convert it and compare

where cast(col as datetime) between datefrom and dateto]]></description>
		<content:encoded><![CDATA[<p>What is the dateformat? Depending on it you can convert it and compare</p>
<p>where cast(col as datetime) between datefrom and dateto</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Megha</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-227824</link>
		<dc:creator><![CDATA[Megha]]></dc:creator>
		<pubDate>Thu, 29 Dec 2011 07:00:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-227824</guid>
		<description><![CDATA[SELECT DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0)]]></description>
		<content:encoded><![CDATA[<p>SELECT DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atif</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-226578</link>
		<dc:creator><![CDATA[Atif]]></dc:creator>
		<pubDate>Tue, 27 Dec 2011 07:02:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-226578</guid>
		<description><![CDATA[thnx its done...]]></description>
		<content:encoded><![CDATA[<p>thnx its done&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atif</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-226571</link>
		<dc:creator><![CDATA[Atif]]></dc:creator>
		<pubDate>Tue, 27 Dec 2011 06:33:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-226571</guid>
		<description><![CDATA[I have a vachar field in DB to store dates (which is actually creating problem).Now i can&#039;t change the field type as i contains real data and lots of other application uses this DB. i want to design a query which compares dates i.e select * form Emp where  joining_date(its in varchar type) between &#039;datefrom&#039; and &#039;dateto&#039;]]></description>
		<content:encoded><![CDATA[<p>I have a vachar field in DB to store dates (which is actually creating problem).Now i can&#8217;t change the field type as i contains real data and lots of other application uses this DB. i want to design a query which compares dates i.e select * form Emp where  joining_date(its in varchar type) between &#8216;datefrom&#8217; and &#8216;dateto&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roberto</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-202120</link>
		<dc:creator><![CDATA[Roberto]]></dc:creator>
		<pubDate>Tue, 22 Nov 2011 10:46:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-202120</guid>
		<description><![CDATA[What about  using the numerical rappresentation of a DateTime?
CONVERT(INT,GetDate()) give the date part of datetime rappresentation.
So my suggestion is to use CONVERT(DATETIME, CONVERT(INT,GetDate())).
Another advantage to integer cast versus string cast is that it&#039;s simpler to use in ordering, filtering and so on (think about BETWEEN).]]></description>
		<content:encoded><![CDATA[<p>What about  using the numerical rappresentation of a DateTime?<br />
CONVERT(INT,GetDate()) give the date part of datetime rappresentation.<br />
So my suggestion is to use CONVERT(DATETIME, CONVERT(INT,GetDate())).<br />
Another advantage to integer cast versus string cast is that it&#8217;s simpler to use in ordering, filtering and so on (think about BETWEEN).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blue</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-187094</link>
		<dc:creator><![CDATA[Blue]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 14:13:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-187094</guid>
		<description><![CDATA[How to select only date part without time..can some one help me.

Thanks.]]></description>
		<content:encoded><![CDATA[<p>How to select only date part without time..can some one help me.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ipatni</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-176040</link>
		<dc:creator><![CDATA[ipatni]]></dc:creator>
		<pubDate>Fri, 07 Oct 2011 10:26:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-176040</guid>
		<description><![CDATA[how to select only date part
when selecting two dates using Between clause]]></description>
		<content:encoded><![CDATA[<p>how to select only date part<br />
when selecting two dates using Between clause</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-172787</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 28 Sep 2011 11:33:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-172787</guid>
		<description><![CDATA[where datetimecol&gt;=&#039;your_date&#039; and datetimecol&lt;dateadd(day,1,&#039;your_date&#039;)]]></description>
		<content:encoded><![CDATA[<p>where datetimecol&gt;=&#8217;your_date&#8217; and datetimecol&lt;dateadd(day,1,&#039;your_date&#039;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-172785</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 28 Sep 2011 11:32:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-172785</guid>
		<description><![CDATA[or you can use 

select year(getdate())]]></description>
		<content:encoded><![CDATA[<p>or you can use </p>
<p>select year(getdate())</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-172784</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 28 Sep 2011 11:30:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-172784</guid>
		<description><![CDATA[select convert(datetime,your_nvarchar_date,103)]]></description>
		<content:encoded><![CDATA[<p>select convert(datetime,your_nvarchar_date,103)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: siva venkat</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-172611</link>
		<dc:creator><![CDATA[siva venkat]]></dc:creator>
		<pubDate>Tue, 27 Sep 2011 21:28:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-172611</guid>
		<description><![CDATA[how to convert nvarchar data in the format dd-MM-yyyy into datetime or smalldatetime while runtime?]]></description>
		<content:encoded><![CDATA[<p>how to convert nvarchar data in the format dd-MM-yyyy into datetime or smalldatetime while runtime?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-166242</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 07 Sep 2011 13:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-166242</guid>
		<description><![CDATA[This is most reliable method

select dateadd(day,datediff(day,0,getdate()),0)]]></description>
		<content:encoded><![CDATA[<p>This is most reliable method</p>
<p>select dateadd(day,datediff(day,0,getdate()),0)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-166241</link>
		<dc:creator><![CDATA[Johan]]></dc:creator>
		<pubDate>Wed, 07 Sep 2011 13:15:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-166241</guid>
		<description><![CDATA[Ok, I guess not so short:
The convert function is rounding the value.  So dates that has passed noon will become tomorrows dates -- oops.

thus correct value would be: 
Convert(Int, convert(float, GetUtcDate()))

Converting from float to int will truncate the value.]]></description>
		<content:encoded><![CDATA[<p>Ok, I guess not so short:<br />
The convert function is rounding the value.  So dates that has passed noon will become tomorrows dates &#8212; oops.</p>
<p>thus correct value would be:<br />
Convert(Int, convert(float, GetUtcDate()))</p>
<p>Converting from float to int will truncate the value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-166237</link>
		<dc:creator><![CDATA[Johan]]></dc:creator>
		<pubDate>Wed, 07 Sep 2011 12:57:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-166237</guid>
		<description><![CDATA[A Lot quicker: Convert(DateTime, convert(int, GetUtcDate()))]]></description>
		<content:encoded><![CDATA[<p>A Lot quicker: Convert(DateTime, convert(int, GetUtcDate()))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nerf12345</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-163240</link>
		<dc:creator><![CDATA[nerf12345]]></dc:creator>
		<pubDate>Mon, 29 Aug 2011 13:50:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-163240</guid>
		<description><![CDATA[this is very helpfull :)]]></description>
		<content:encoded><![CDATA[<p>this is very helpfull :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sri</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160542</link>
		<dc:creator><![CDATA[Sri]]></dc:creator>
		<pubDate>Mon, 22 Aug 2011 09:26:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160542</guid>
		<description><![CDATA[Thank you, Madhivanan. I need to do it in the SQL.
The SQL is very simple and working fine.

Thanks again,
Sri]]></description>
		<content:encoded><![CDATA[<p>Thank you, Madhivanan. I need to do it in the SQL.<br />
The SQL is very simple and working fine.</p>
<p>Thanks again,<br />
Sri</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160515</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 22 Aug 2011 07:31:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160515</guid>
		<description><![CDATA[The correct way of doing this is to do at front end application
If you want to do it by sql, use

select datename(year,getdate())+&#039; &#039; +convert(varchar(6),getdate(),9)]]></description>
		<content:encoded><![CDATA[<p>The correct way of doing this is to do at front end application<br />
If you want to do it by sql, use</p>
<p>select datename(year,getdate())+&#8217; &#8216; +convert(varchar(6),getdate(),9)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160511</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 22 Aug 2011 07:19:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160511</guid>
		<description><![CDATA[It is becuase of VARCHAR convertion. SQL Server takes extra time to do that.]]></description>
		<content:encoded><![CDATA[<p>It is becuase of VARCHAR convertion. SQL Server takes extra time to do that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160510</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 22 Aug 2011 07:15:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160510</guid>
		<description><![CDATA[Try this

SELECT * FROM mytablename ORDER BY cast(datefield as datetime) ASC

Also always use proper DATETIME datatype to store dates
http://beyondrelational.com/blogs/madhivanan/archive/2010/06/21/understanding-datetime-column-part-iv.aspx]]></description>
		<content:encoded><![CDATA[<p>Try this</p>
<p>SELECT * FROM mytablename ORDER BY cast(datefield as datetime) ASC</p>
<p>Also always use proper DATETIME datatype to store dates<br />
<a href="http://beyondrelational.com/blogs/madhivanan/archive/2010/06/21/understanding-datetime-column-part-iv.aspx" rel="nofollow">http://beyondrelational.com/blogs/madhivanan/archive/2010/06/21/understanding-datetime-column-part-iv.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: azrol</title>
		<link>http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160305</link>
		<dc:creator><![CDATA[azrol]]></dc:creator>
		<pubDate>Sun, 21 Aug 2011 17:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/#comment-160305</guid>
		<description><![CDATA[i have problem with accending date.... my current syntax is 
SELECT * FROM mytablename ORDER BY datefield ASC. right now my datefield using VARCHAR... 
my result are :
01/02/2009
03/01/2009
04/06/2009
05/03/2009
06/12/2008
07/02/2009

result should be :
06/12/2008
03/01/2009
01/02/2009
07/02/2009

can anyone teach me the simple way to solve this problem and give some help please.... ^_^]]></description>
		<content:encoded><![CDATA[<p>i have problem with accending date&#8230;. my current syntax is<br />
SELECT * FROM mytablename ORDER BY datefield ASC. right now my datefield using VARCHAR&#8230;<br />
my result are :<br />
01/02/2009<br />
03/01/2009<br />
04/06/2009<br />
05/03/2009<br />
06/12/2008<br />
07/02/2009</p>
<p>result should be :<br />
06/12/2008<br />
03/01/2009<br />
01/02/2009<br />
07/02/2009</p>
<p>can anyone teach me the simple way to solve this problem and give some help please&#8230;. ^_^</p>
]]></content:encoded>
	</item>
</channel>
</rss>

