title: Remove time from DateTime sql server 2005
body: <p>I need  date part from datetime. in format of "dd-mm-yyyy"</p>
  
  <p>I have tried follwoing</p>
  
  <p><strong>Query:</strong> </p>
  
  <p><code>select Convert(varchar(11), getdate(),101)</code></p>
  
  <p><strong>Output:</strong></p>
  
  <p><code>01/11/2011</code></p>
  
  <p><strong>Query</strong></p>
  
  <p><code>SELECT cast(floor(cast(GETDATE() as float)) as datetime)</code></p>
  
  <p><strong>Output</strong></p>
  
  <p><code>2011-01-11 00:00:00.000</code></p>
  
  <p><strong>Query:</strong> </p>
  
  <pre><code>SELECT 
      CONVERT(VARCHAR(MAX),DATENAME(DD,GETDATE())) + '-' + 
      CONVERT(VARCHAR(MAX),DATEPART(MONTH,GETDATE())) + '-' + 
      CONVERT(VARCHAR(MAX),DATENAME(YYYY,GETDATE())) `
  </code></pre>
  
  <p><strong>Output:</strong> </p>
  
  <p><code>11-1-2011</code>  i.e. "d-m-yyyy"</p>
  
  <p>I required output in "dd-mm-yyyy" format.</p>