title: SQL Date Col - Use DATE or Varchar?
body: <p>I have very simple code, but the issue is that when I convert a date column to Varchar(10), then I am not fetching distinct dates and sort is not working as desired; when I use DATE format, then I am fetching distinct dates and date sort is working, but I get datetime - 2017-02-01 12:00:00 AM <em>(I don't want the time part)</em>
  Here is the code:</p>
  
  <pre><code>SELECT DISTINCT
  --CONVERT(varchar(10), DATEADD(month, DATEDIFF(month, 0, (MyDate)), 0), 101) AS MonthValue,
   CONVERT(DATE, DATEADD(month, DATEDIFF(month, 0, (MyDate)), 0)) AS MonthValue
  FROM dbo.Mytable
  WHERE MyDate &gt;= GETDATE()-366
  ORDER BY MonthValue DESC
  </code></pre>