Dim dtp1 As WinForm.DateTimePicker = e.Form.Controls("起始日期")Dim dtp2 As WinForm.DateTimePicker = e.Form.Controls("结束日期")
If dtp1.Value Is Nothing Then
msgbox("起始日期不能为空")
Return
End If
If dtp2.Value Is Nothing Then
msgbox("结束日期不能为空")
Return
End If
e.Form.Controls("Table1").Table.Fill("Select 名称,规格,SUM(数量) AS 数量,单位 From {固定资产入库}WHERE 入库日期 >= #"& dtp1.Value &"# AND 入库日期 <= #"& dtp2.Value &"# GROUP BY 名称,规格,单位", True )