title: Returning Month Name in SQL Server Query
body: <p>Using <code>SQL Server 2008</code>, I have a query that is used to create a view and I'm trying to display a <strong>month's name</strong> instead of an integer. </p>
  
  <p>In my database, the <code>datetime</code> is in a column called <code>OrderDateTime</code>. The lines in the query that return the date is:</p>
  
  <pre><code>DATENAME(yyyy, S0.OrderDateTime) AS OrderYear,
  DATEPART(MONTH, S0.OrderDateTime) AS OrderMonth
  </code></pre>
  
  <p>This returns a column of years and a column of months as integers. I want to return the month names <code>(Jan, Feb, etc</code>). I've tried:</p>
  
  <pre><code>CONVERT(varchar(3), DATEPART(MONTH, S0.OrderDateTime) AS OrderMonth
  </code></pre>
  
  <p>This is obviously is incorrect, as I get </p>
  
  <blockquote>
    <p>Incorrect syntax near 'AS'</p>
  </blockquote>
  
  <p>message. What is the proper syntax for my query?</p>