title: SQL Cast from int to decimal
body: <p>I have two columns in a table that are populated with integer values. For each record, I want to divide the values of those two columns and format the output so that the decimal point is moved to places to the right.</p>
  
  <p>For example, if I have values of the two columns for one record as 4 and 1 and I want to divide 1 by 4 (so 1/4) then I want the output to be 25.00.</p>
  
  <p>Here is the last thing I tried a bit ago:</p>
  
  <pre><code>CAST(Total AS Decimal(2))/CAST(TotalAnswers AS Decimal(2)) AS 'Percent' 
  </code></pre>
  
  <p>I have not been able to find a syntactical explanation of the CAST function to see what the parameter passed in for decimal represents. When I change it, it does sometimes change the number of places to the right of the decimal but the results are not always what I expect so I would like to get a little help on this.</p>