title: SQL Currency Formatting
body: <p>I am running into an issue when trying to convert my query to currency format.  Below is the code and I keep ending up with two different error messages when attempting the conversion on the 'purchases' sum.</p>
  
  <p>When using: </p>
  
  <pre><code>sum(case 
  when trandate between '2015-01-01' and '2015-03-31'
       then format(purchases, 'C', 'en-US') 
  else 0 end) as q1 
  </code></pre>
  
  <p>I get error message 102</p>
  
  <p>When using: </p>
  
  <pre><code>sum(case 
  when trandate between '2015-01-01' and '2015-03-31'
       then ('$' + CONVERT(varchar(12), purchases, 1))
  else 0 end) as 'Q1 2015'
  </code></pre>
  
  <p>I get error message 245.</p>
  
  <p>I cant seem to find a solution to either.  When just simply querying the data at a line level and using both formats I get a $xxx returned.  Any help would be greatly appreciated.</p>
  
  <p>Cheers</p>