Dim y As Integer = Date.Today.Year
Dim m As Integer = Date.Today.Month
Dim rq1 As New Date(y, m, 1)
Dim rq2 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
Dim Filter1 As String
Dim Filter2 As String
filter1 = "入库日期 >= #" & rq1 & "# " & " And 入库日期 <= #" & rq2 & "#"
filter2 = "出库日期 >= #" & rq1 & "# " & " And 出库日期 <= #" & rq2 & "#"
........
Dim s1 As Double = 0
For Each cdr As DataRow In drs
If cdr("入库日期") < rq1 Then
s1 += cdr("入库数量")
End If
Next
请教大师,上边黑体大写的代码写法正确吗?