Dim t1 As Date = e.Form.Controls("DateTimePicker1").value Dim t2 As Date = e.Form.Controls("DateTimePicker2").value Dim s1 As Double =DataTables("销售明细").Compute("Sum(数量)", "产品名称 ='A气'And 会员卡 <> 0 And 销售日期 <= #" & t2 & "# And 销售日期 >= #" & t1 & "#") MessageBox.Show(s1)