title: SQL decimal conversion
body: <p>I have some problem during converting this decimal value shown below: </p>
  
  <pre><code>21.6080402010050
  </code></pre>
  
  <p>Can anyone help me to convert this to become <code>21.6</code>?</p>
  
  <p>I have tried with this but it doesn't work.</p>
  
  <pre><code>(convert(decimal(10, 2), SUM(t1.TOTAL))
  </code></pre>
  
  <p>This is the query</p>
  
  <pre><code>SELECT 
      t1.LINE_NO, t1.E_FIELD, t1.F_FIELD, t1.G_FIELD, t1.HSA_STATUS, 
      t1.FAMILY, t1.CACHE_FAMILY, 
      SUM(t1.TOTAL) AS CountOfLineNo, t2.TotalOfLineNo, 
      (convert(decimal(8,1), SUM(t1.TOTAL)) * 100 / t2.TotalOfLineNo ) AS Percentage
  FROM (
      SELECT 
          LINE_NO, E_FIELD,F_FIELD,G_FIELD,HSA_STATUS,FAMILY,CACHE_FAMILY, 
          Count(LINE_NO) as Total
      FROM TX_HSA_SUMM
      WHERE MT_TIMESTAMP2 BETWEEN ('2013-03-07 10:10:00') AND ('2013-03-08 10:20:00')
      GROUP BY LINE_NO, E_FIELD, F_FIELD, G_FIELD, HSA_STATUS, FAMILY, CACHE_FAMILY) AS t1 
  LEFT JOIN (
        SELECT LINE_NO, COUNT(LINE_NO) AS TotalOfLineNo
        FROM TX_HSA_SUMM
        WHERE MT_TIMESTAMP2 BETWEEN ('2013-03-07 10:10:00') AND ('2013-03-08 10:20:00')
        GROUP BY LINE_NO) AS t2 ON t1.LINE_NO = t2.LINE_NO
  GROUP BY 
     t1.LINE_NO, t1.E_FIELD, t1.F_FIELD, t1.G_FIELD, t1.HSA_STATUS, t1.FAMILY, 
     t1.CACHE_FAMILY, t1.Total, t2.TotalOfLineNo
  ORDER BY 
     t1.LINE_NO, t1.E_FIELD, t1.F_FIELD, t1.G_FIELD, t1.HSA_STATUS, t1.FAMILY, 
     t1.CACHE_FAMILY, t1.Total, t2.TotalOfLineNo
  </code></pre>
  
  <p>and output is </p>
  
  <pre><code>LINE_NO E_FIELD F_FIELD G_FIELD HSA_STATUS FAMILY CACHE_FAMILY CountOfLineNo    TotalOfLineNo   Percentage
  23053B  00000   00000   00000   S   SUMMIT  WER 43  199 21.608040201005%
  </code></pre>