title: How to get only date part from a datetime column in SQL Server and without 0s
body: <p>I have a <code>datetime</code> column in SQL Server. </p>
  
  <p>It looks like <code>2015-04-16 00:13:00.000</code>.</p>
  
  <p>I would like to get only the date component: <code>2015-05-01</code></p>
  
  <p>I tried applying the cast as follows</p>
  
  <pre><code>update dbo.MyTableDateOnly 
  set START_DATE = CAST(START_DATE AS DATE) 
  from dbo.MyTableDateOnly
  </code></pre>
  
  <p>But I get as follows, and this bothers me because when I copy to Excel, I only see the zeros. What I want to see is the date part, as mentioned above.</p>
  
  <pre><code>2015-05-01 00:00:00.000
  </code></pre>
  
  <p>Also, is there a way, to split the date component, into the year, month and day columns, in sql?</p>
  
  <p>EDIT : I'm using Microsoft SQL Server. To get individual columns for YEAR, MONTH and DAY, I tried this based on some of the replies. But I get an error</p>
  
  <pre><code>ALTER TABLE dbo.MyTableDateOnly 
  ADD ADMIT_YEAR varchar(100)
  
  ALTER TABLE dbo.MyTableDateOnly 
  ADD ADMIT_MONTH varchar(100)
  
  ALTER TABLE dbo.MyTableDateOnly 
  ADD ADMIT_DAY varchar(100)
  
  UPDATE dbo.MyTableDateOnly 
  SET ADMIT_YEAR = (SELECT DATEPART(year, START_DATE) 
                    FROM dbo.MyTableDateOnly)
  </code></pre>
  
  <p>I get the error</p>
  
  <blockquote>
    <p>Msg 512, Level 16, State 1, Line 24<br>
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , >, >= or when the subquery is used as an expression.</p>
  </blockquote>