SQL - 如何舍入到2位小数

时间:2016-04-17 19:32:46

标签: sql vb.net select decimal rounding

我的查询如下

Dim DoneAvgCont As New OleDbCommand("select avg(diffpay) ,conrtname from metersdone",con)
Dim DoneAvgContdb As New OleDbDataAdapter(DoneAvgCont)
    Dim DoneAvgContDt As New DataTable

avg(diffpay)列的结果如55.2516494664,我想要舍入到55.25

我使用visual basic.net 2015,我从访问

获取

1 个答案:

答案 0 :(得分:1)

在第一行编辑您的查询,如下所示

Dim DoneAvgCont As New OleDbCommand("select round(avg(diffpay),2) ,conrtname from metersdone",con)