添加$符号并舍入值

时间:2014-03-19 10:05:34

标签: sql sql-server sql-server-2008

我有计算字段,我需要将这些列值四舍五入。

[YearlyProfit_2014] [Yearly Profit], [YearlyProfit_2014] = [MonthlyProfit]/4, [MonthlyProfit] = [WeeklySum]* .50], isnull(sum([YearlyProfit_2014]),0) [YearlyProfit]

现在这些计算列有十进制值,我需要舍入值。

1 个答案:

答案 0 :(得分:2)

select [MonthlyProfit] = '$' + cast(round([WeeklySum]* .50, 18, 2) as varchar(19))