title: Cannot convert a char value to money in SQL
body: <p>I have a table called 'companyInfo' and the data type of 'Amount' is <code>nvarchar</code> and sample data looks like:</p>
  
  <p><strong>companyInfo</strong></p>
  
  <pre><code>IDs | company   | year | Amount
  ----+-----------+------+-------
  1   | Company A | 2011 | 40.00
  2   | Company B | 2011 | Null
  2   | Company C | 2011 | 100.00
  4   | Company D | 2011 | 205.11
  5   | Company E | 2011 | 0
  6   | Company F | 2011 | Null
  </code></pre>
  
  <p>I wrote Query like below:</p>
  
  <pre><code>select IDs
    , company
    , sum(ISNULL(CAST(Amount AS MONEY), 0)) Amount
    , year
  from companyInfo 
  where Amount is not null 
    and year(cast(year as date)) = '2018'
  group by IDs
    , company
    , Amount
    , year
  </code></pre>
  
  <p>got below Error:</p>
  
  <blockquote>
    <p>Error:<br>
    Msg 235, Level 16, State 0, Line 27
    Cannot convert a char value to money. The char value has incorrect syntax.</p>
  </blockquote>