﻿<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns="http://www.w3.org/2005/Atom">
  <id>http://www.thewayithink.co.uk/</id>
  <title>thebeebs - How to Floor an SQL DateTime</title>
  <updated>2008-08-13T04:37:31+00:00</updated>
  <link href="http://www.thewayithink.co.uk/" />
  <link rel="self" href="http://www.thewayithink.co.uk/syndication.axd?format=atom" />
  <subtitle>Zeroing the desk - Ignore the design</subtitle>
  <author>
    <name>My name</name>
  </author>
  <generator uri="http://dotnetblogengine.net/" version="1.0.0.0">BlogEngine.Net Syndication Generator</generator>
  <blogChannel:blogRoll>http://www.thewayithink.co.uk/opml.axd</blogChannel:blogRoll>
  <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
  <dc:creator>My name</dc:creator>
  <dc:description>Zeroing the desk - Ignore the design</dc:description>
  <dc:language>en-US</dc:language>
  <dc:title>thebeebs</dc:title>
  <geo:lat>0.000000</geo:lat>
  <geo:long>0.000000</geo:long>
  <entry>
    <id>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_f380acd1-ee37-4d4e-aec6-f365900fef07</id>
    <title>Tomislav on &lt;a href="/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_f380acd1-ee37-4d4e-aec6-f365900fef07" alt="/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_f380acd1-ee37-4d4e-aec6-f365900fef07"&gt;How to Floor an SQL DateTime&lt;/a&gt;</title>
    <updated>2008-08-13T04:37:31+00:00</updated>
    <link rel="self" href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_f380acd1-ee37-4d4e-aec6-f365900fef07" />
    <link href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_f380acd1-ee37-4d4e-aec6-f365900fef07" />
    <author>
      <name>Tomislav</name>
    </author>
    <summary type="html">select cast(convert(varchar,getdate(),106) as datetime)</summary>
    <published>2008-08-13T04:37:31+00:00</published>
    <link rel="related" href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_f380acd1-ee37-4d4e-aec6-f365900fef07#comment" />
    <dc:publisher>Tomislav</dc:publisher>
    <pingback:server>http://www.thewayithink.co.uk/pingback.axd</pingback:server>
    <pingback:target>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_f380acd1-ee37-4d4e-aec6-f365900fef07</pingback:target>
    <wfw:comment>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_f380acd1-ee37-4d4e-aec6-f365900fef07#comment</wfw:comment>
    <wfw:commentRss>http://www.thewayithink.co.uk/syndication.axd?post=f380acd1-ee37-4d4e-aec6-f365900fef07</wfw:commentRss>
  </entry>
  <entry>
    <id>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_dc4e179e-dafa-424e-b99e-10712fcb576c</id>
    <title>nishant on &lt;a href="/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_dc4e179e-dafa-424e-b99e-10712fcb576c" alt="/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_dc4e179e-dafa-424e-b99e-10712fcb576c"&gt;How to Floor an SQL DateTime&lt;/a&gt;</title>
    <updated>2009-02-11T22:01:19+00:00</updated>
    <link rel="self" href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_dc4e179e-dafa-424e-b99e-10712fcb576c" />
    <link href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_dc4e179e-dafa-424e-b99e-10712fcb576c" />
    <author>
      <name>nishant</name>
    </author>
    <summary type="html">insted of this you can use 
select convert(datetime,convert(int, getdate())) as date 
it is more easy </summary>
    <published>2009-02-11T22:01:19+00:00</published>
    <link rel="related" href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_dc4e179e-dafa-424e-b99e-10712fcb576c#comment" />
    <dc:publisher>nishant</dc:publisher>
    <pingback:server>http://www.thewayithink.co.uk/pingback.axd</pingback:server>
    <pingback:target>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_dc4e179e-dafa-424e-b99e-10712fcb576c</pingback:target>
    <wfw:comment>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_dc4e179e-dafa-424e-b99e-10712fcb576c#comment</wfw:comment>
    <wfw:commentRss>http://www.thewayithink.co.uk/syndication.axd?post=dc4e179e-dafa-424e-b99e-10712fcb576c</wfw:commentRss>
  </entry>
  <entry>
    <id>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_2999f0ae-cfad-472c-87b7-0ad00bb2118c</id>
    <title>&lt;a class="comment_auth" href="http://www.thewayithink.co.uk/" alt="http://www.thewayithink.co.uk/" title="http://www.thewayithink.co.uk/"&gt;thebeebs&lt;/a&gt; on &lt;a href="/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_2999f0ae-cfad-472c-87b7-0ad00bb2118c" alt="/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_2999f0ae-cfad-472c-87b7-0ad00bb2118c"&gt;How to Floor an SQL DateTime&lt;/a&gt;</title>
    <updated>2009-02-12T04:20:19+00:00</updated>
    <link rel="self" href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_2999f0ae-cfad-472c-87b7-0ad00bb2118c" />
    <link href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_2999f0ae-cfad-472c-87b7-0ad00bb2118c" />
    <author>
      <name>thebeebs</name>
    </author>
    <summary type="html">@nishant, That won't work, if you run it with a date with a time past 12:00 then it will add a day on to the result date:


&lt;strong&gt;Morining Test:&lt;/strong&gt;
DECLARE @Testdate datetime 
SET @Testdate = convert(datetime, '03/June/1982 00:00:00')
Select @Testdate
select convert(datetime,convert(int, @Testdate)) as date
RESULT 1: 1982-06-03 00:00:00.000
RESULT 2: 1982-06-03 00:00:00.000

&lt;strong&gt;Afternoon Test:&lt;/strong&gt;
DECLARE @Testdate datetime 
SET @Testdate = convert(datetime, '03/June/1982 13:00:00')
Select @Testdate
select convert(datetime,convert(int, @Testdate)) as date
RESULT 1: 1982-06-03 13:00:00.000
RESULT 2: 1982-06-04 00:00:00.000</summary>
    <published>2009-02-12T04:20:19+00:00</published>
    <link rel="related" href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_2999f0ae-cfad-472c-87b7-0ad00bb2118c#comment" />
    <dc:publisher>thebeebs</dc:publisher>
    <pingback:server>http://www.thewayithink.co.uk/pingback.axd</pingback:server>
    <pingback:target>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_2999f0ae-cfad-472c-87b7-0ad00bb2118c</pingback:target>
    <wfw:comment>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_2999f0ae-cfad-472c-87b7-0ad00bb2118c#comment</wfw:comment>
    <wfw:commentRss>http://www.thewayithink.co.uk/syndication.axd?post=2999f0ae-cfad-472c-87b7-0ad00bb2118c</wfw:commentRss>
  </entry>
  <entry>
    <id>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_16d7e226-1554-44e4-8b9e-0dec2d90ceaf</id>
    <title>nishant on &lt;a href="/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_16d7e226-1554-44e4-8b9e-0dec2d90ceaf" alt="/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_16d7e226-1554-44e4-8b9e-0dec2d90ceaf"&gt;How to Floor an SQL DateTime&lt;/a&gt;</title>
    <updated>2009-02-12T04:42:43+00:00</updated>
    <link rel="self" href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_16d7e226-1554-44e4-8b9e-0dec2d90ceaf" />
    <link href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_16d7e226-1554-44e4-8b9e-0dec2d90ceaf" />
    <author>
      <name>nishant</name>
    </author>
    <summary type="html">Thank a lot &lt;img src="/editors/tiny_mce_3_3_9_2/plugins/emotions/img/smiley-smile.gif" class="flag" alt="Smile" /&gt;</summary>
    <published>2009-02-12T04:42:43+00:00</published>
    <link rel="related" href="http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_16d7e226-1554-44e4-8b9e-0dec2d90ceaf#comment" />
    <dc:publisher>nishant</dc:publisher>
    <pingback:server>http://www.thewayithink.co.uk/pingback.axd</pingback:server>
    <pingback:target>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_16d7e226-1554-44e4-8b9e-0dec2d90ceaf</pingback:target>
    <wfw:comment>http://www.thewayithink.co.uk/post/2008/07/03/How-to-Floor-an-SQL-datatime.aspx#id_16d7e226-1554-44e4-8b9e-0dec2d90ceaf#comment</wfw:comment>
    <wfw:commentRss>http://www.thewayithink.co.uk/syndication.axd?post=16d7e226-1554-44e4-8b9e-0dec2d90ceaf</wfw:commentRss>
  </entry>
</feed>