Formatting derived output in MS SQL view
Posted on 2014-04-28
I have this derived column in a SQL view:
case when l.qty_comp != 0
then round(l.qty_scrap / l.qty_comp * 100, 0)
qty_comp and qty_scrap in the source table are both defined as decimal (13,4)
The output looks like this:
14.000000000000000000 (the actual results followed by the decimal point and 18 zeroes.
How can I get the output to look like a whole number, e.g, 14?
And, why does it format the data this way?