vb6.0+datagrid+access+adodc
vb6.0+datagrid+access+adodc,条件选择“信息管理部”和日期7月后,点“汇总按钮”后,部门汇总里程和是正确的,但出现了5月和8月的。程序代码:
If Check1.Value Then 'Adodc3.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\vehicle.mdb " & ";persist security info=false" Adodc3.RecordSource = "select sum(里程统计) as 部门汇总 from cllclist where 用车部门='" & Combo1.Text & "' and month(出发时间)='" & Combo4.Text & " ' group by 用车部门" Adodc3.Refresh Text1.Text = Adodc3.Recordset.Fields("部门汇总").Value End If