Dim y As Integer = 2011 '指定年份 Dim m As Integer = 6 '指定月份 Dim dt1 As New Date(y, m, 1) Dim dt2 As New Date(y, m, Date.DaysInMonth(2011,6)) '获取该月的最后一天 Dim Filter As String Filter = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "#" if DataTables("订单").find(Filter) Is Nothing Then ‘如果这个月没有数据 Dim dr As DataRow = DataTables("订单").AddNew() dr("日期") = dt1 End if