Private Sub Command1_Click()If Option1.Value = True ThenAdodc1.RecordSource = "select 经手人,sum(订单总金额)as 订单总金额 ,format(订单时间,'yyyy-mm') as 订单时间 from A_xsjl " _& " where format(订单时间,'yyyy-mm')= '2015-'+'" _+ Trim(Text1.Text) + "'group by 经手人,format(订单时间,'yyyy-mm')"Adodc1.RefreshSet DataGrid1.DataSource = Adodc1ElseIf Option2.Value = True ThenAdodc1.RecordSource = "select 商品名称,sum(数量)as 合计销售数量 from A_xsjl group by 商品名称 order by 2 desc"Adodc1.RefreshSet DataGrid1.DataSource = Adodc1End IfEnd IfEnd Sub
添加回答
举报
0/150
提交
取消