我总结了值,下面这个查询对值进行求和,如果没有值则返回零。
如何舍入这些列的值。
这是我的查询:
isnull(sum([Old_Values]),0) [Old Values],
[New_Value] = isnull(sum([Yearly_Value]-[Previous_Year_Value]),0)
即使是我用于计算的查询,我也需要对值进行舍入
[Product_Price] = [Product_Profit]/4,
[Product_Profit] = [ActualValue] * 0.75,
[GrossValue]
我该怎么做?
答案 0 :(得分:1)
you could use FLOOR() or CEILING()
像这样!
[Product_Price] = FLOOR([Product_Profit]/4),
[Product_Profit] = FLOOR([ActualValue] * 0.75)
答案 1 :(得分:1)
[Product_Price] =Round([Product_Profit]/4,0),
[Product_Profit] = Round([ActualValue] * 0.75,0)
答案 2 :(得分:1)
您可以使用ROUND
,例如
[Product_Price] =Round([Product_Profit]/4,2),
[Product_Profit] = Round([ActualValue] * 0.75,2),
[GrossValue]