title: SQLServer CAST and divide 2 decimal numbers, followed by multiplication gives too many decimal places
body: <p>I'm working in SQL Server 2008.  I have an alias column that I'm creating via the following formula:  </p>
  
  <pre><code>col1 / col2 * some_number  
  </code></pre>
  
  <p>col1 and col2 are nvarchars in my table, but they're really integers.  some_number is an integer.  If I blindly do col1 / col2, I will get 0 for most.  So, I need to cast them as decimals.  I want there to be a maximum of 2 decimal places after the decimal point.  Here is what I have currently:  </p>
  
  <pre><code>CAST(col1 AS DECIMAL(10,2)) / CAST(col2 AS DECIMAL(10,2)) * 100  
  </code></pre>
  
  <p>However, this returns far more decimal places than just 2.  How do I fix my code to return just 2 decimal places?</p>