SQL Divide输出不起作用

时间:2018-01-08 18:06:13

标签: sql tsql

下面的代码将结果向上舍入小数位。

123 abandoned calls / 2473 Call volume * 100应该给我4.97但显示5.00有任何想法如何解决此问题?

convert (Decimal (10,2),Cast (Abandoned as decimal(10,2))/Cast ([Call Volumes] as decimal(10,2)))*100 as Abandon_Rate

1 个答案:

答案 0 :(得分:0)

你可以向前移动100,只需要施放一次:

SELECT 100 * Cast (Abandoned as decimal(10,2))/[Call Volumes] as Abandon_Rate

结果应该是这样的:

Abandon_Rate
--------------------
4.9737161342498