title: CONVERT(DATETIME, DATETIME, 131)
body: <p>I can't seem to figure this one out and tried searching stackoverflow.</p>
  
  <p>I have two lines where I want to convert the date.  I didn't create these datatypes or tables and don't want to change the date types in case it messes something up.</p>
  
  <p>I have one table where one of the columns is of type (datetime2(7), not null).
  I have another table where the column is of type (datetime, null).</p>
  
  <p>when I do a query they return a time (respectively) that looks like</p>
  
  <pre><code>2015-01-25 10:11:50.9050000
  
  2015-01-19 10:24:42.323
  </code></pre>
  
  <p>The above is before I do any conversion or casting.</p>
  
  <p>I'd like to convert the format of those to</p>
  
  <p>dd/mm/yy hh:mi:ss:mmmAM</p>
  
  <p>So I used the code below (respectively)</p>
  
  <pre><code>SELECT TagName, CONVERT(DateTime, EventStamp, 131) AS ConvertedTime
  FROM ALMDB.dbo.Hist
  </code></pre>
  
  <p>and</p>
  
  <pre><code>SELECT TagName, CONVERT(DateTime, DateTime, 131) AS ConvertedTime
  FROM ALMDB.dbo.Hist
  </code></pre>
  
  <p>But it doesn't seem to work.  It drops the ss (seconds) part and the month/day/year portion does't come out according to style 131.  Anyone know why?  It looks like below</p>
  
  <pre><code>25/01/2015 10:11 AM
  19/01/2015 10:24 AM
  </code></pre>
  
  <p>I tried a bunch of way and it doesn't seem to work.  I'm running MS SQL server 2012 and just doing the query in SQL Server Manager Studio.</p>