以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  小于日期问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=193943)

--  作者:g1j2h3
--  发布时间:2024/10/27 21:06:00
--  小于日期问题
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

请教大师,上边黑体大写的代码写法正确吗?

--  作者:有点蓝
--  发布时间:2024/10/27 21:12:00
--  
语法没有问题