vb按天对ACCESS数据字段求和.TKS... 10
已经添加了DTPicker,要求运行时..用DTPicker选择一日期.按钮2时.仅对当天的数据进行求和?数据库字段名称是:实时日期数据类型:日期/时间默认值=Now()...
已经添加了DTPicker,要求运行时..用DTPicker选择一日期.按钮2时.仅对当天的数据进行求和?
数据库 字段名称是:实时日期 数据类型:日期/时间 默认值=Now()
Private Sub Command2_Click() '对所有数据进行求和
Dim Conn As New adodb.Connection
Dim rs As New adodb.Recordset
Dim i As Long
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\VB\0913mdb\db1.mdb"
For i = 1 To 31
rs.Open "select sum(val([" & i & "])) from 表1", Conn, 1, 1
Text2(i).Text = rs(0)
rs.Close
Next
Set rs = Nothing
Conn.Close
Set Conn = Nothing
End Sub 展开
数据库 字段名称是:实时日期 数据类型:日期/时间 默认值=Now()
Private Sub Command2_Click() '对所有数据进行求和
Dim Conn As New adodb.Connection
Dim rs As New adodb.Recordset
Dim i As Long
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\VB\0913mdb\db1.mdb"
For i = 1 To 31
rs.Open "select sum(val([" & i & "])) from 表1", Conn, 1, 1
Text2(i).Text = rs(0)
rs.Close
Next
Set rs = Nothing
Conn.Close
Set Conn = Nothing
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询