诸位你们好! 请问我用如下语句求出了某一列查询的共计值,但如何求出共计值的平均值?请帮忙修改一下,谢谢! sum = 0 rs_jiaozhu.MoveFirst While Not rs_jiaozhu.EOF sum = sum + Val(rs_jiaozhu.Fields(2).Value) rs_jiaozhu.MoveNext Wend
Dim sum As Long, count As integer sum = 0 count=0 rs_jiaozhu.MoveFirst While Not rs_jiaozhu.EOF sum = sum + Val(rs_jiaozhu.Fields(2).Value) count=count+1 rs_jiaozhu.MoveNext Wend Dim ave As Single ' or Integer ,etc ave=sum/count