snipt

Ctrl+h for KB shortcuts

SQL

Casting a Datetime to Date Sqlserver 2008

cast(getdate() As Date)
https://snipt.net/embed/842fae8370d256c3ff55a2a5a1656f88/
/raw/842fae8370d256c3ff55a2a5a1656f88/
842fae8370d256c3ff55a2a5a1656f88
sql
SQL
1
2019-06-18T00:54:43
True
False
False
Feb 13, 2014 at 02:52 PM
/api/public/snipt/113504/
casting-a-datetime-to-date-sqlserver-2008
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">cast</span><span class="p">(</span><span class="n">getdate</span><span class="p">()</span> <span class="k">As</span> <span class="nb">Date</span><span class="p">)</span> </span></pre></div> </td></tr></table>
casting, date, datetime, sqlserver