title: How to format date in SQL Server 2016
body: <p>I would like to format the date as <code>ddmmyyyy</code>. I am using SQL Server 2016 and I have found the following line that seemed to do the job but it doesn't.</p>
  
  <p>Here is the code I used</p>
  
  <pre><code>DECLARE @ChangedDate as date
  
  SET @ChangedDate = CONVERT(DATE, GETDATE())
  SET @ChangedDate = REPLACE(CONVERT(CHAR(10), @ChangedDate, 103), '-','')
  </code></pre>
  
  <p>The result when saving the document remains "2015-05-02" instead of what I want "02052015"</p>
  
  <p>What's wrong here?</p>