以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  代码确认  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=122422)

--  作者:xinyu88
--  发布时间:2018/7/25 11:14:00
--  代码确认

 

老师,帮忙看看下面代码哪里有问题呢?谢谢


Select Case e.DataCol.Name
    Case "加工工序","毛坯编码","生产日期","班次"
        Dim Filter3 As String = "毛坯编码 = \'" & e.DataRow("毛坯编码") & "\' and 加工工序 = \'" & e.DataRow("加工工序") & "\' and 生产日期 = \'" Date.Today "\' and 班次 = \'"中班  "\'"
        e.DataRow("完成数量") = DataTables("每日排产").SQLCompute("Sum(加工数量)", Filter3)
        e.DataRow.save
End Select

Select Case e.DataCol.Name
    Case "加工工序","毛坯编码","生产日期","班次"
        Dim Filter3 As String = "毛坯编码 = \'" & e.DataRow("毛坯编码") & "\' and 加工工序 = \'" & e.DataRow("加工工序") & "\' and 生产日期 = \'" Date.Today +1 "\' and 班次 = \'"夜班  "\'"
        e.DataRow("完成数量") = DataTables("每日排产").SQLCompute("Sum(加工数量)", Filter3)
        e.DataRow.save
End Select


--  作者:有点甜
--  发布时间:2018/7/25 11:23:00
--  
Select Case e.DataCol.Name
    Case "加工工序","毛坯编码","生产日期","班次"
        Dim Filter3 As String = "毛坯编码 = \'" & e.DataRow("毛坯编码") & "\' and 加工工序 = \'" & e.DataRow("加工工序") & "\' and 生产日期 = #" & Date.Today & "# And 班次 = \'中班\'"
        e.DataRow("完成数量") = DataTables("每日排产").SQLCompute("Sum(加工数量)", Filter3)
        e.DataRow.save
End Select

--  作者:xinyu88
--  发布时间:2018/7/25 11:24:00
--  

当天日期上加1天呢,如红色

Select Case e.DataCol.Name
Case "加工工序","毛坯编码","生产日期","班次"
Dim Filter3 As String = "毛坯编码 = \'" & e.DataRow("毛坯编码") & "\' and 加工工序 = \'" & e.DataRow("加工工序") & "\' and 生产日期 = #" & Date.Today & "# And 班次 = \'中班\'"
e.DataRow("完成数量") = DataTables("每日排产").SQLCompute("Sum(加工数量)", Filter3)
e.DataRow.save
End Select
Select Case e.DataCol.Name
Case "加工工序","毛坯编码","生产日期","班次"
Dim Filter3 As String = "毛坯编码 = \'" & e.DataRow("毛坯编码") & "\' and 加工工序 = \'" & e.DataRow("加工工序") & "\' and 生产日期 = #" & Date.Today +1 & "# And 班次 = \'中班\'"
e.DataRow("完成数量") = DataTables("每日排产").SQLCompute("Sum(加工数量)", Filter3)
e.DataRow.save
End Select
--  作者:有点甜
--  发布时间:2018/7/25 11:39:00
--  

 

Dim Filter3 As String = "毛坯编码 = \'" & e.DataRow("毛坯编码") & "\' and 加工工序 = \'" & e.DataRow("加工工序") & "\' and 生产日期 = #" & Date.Today.adddays(1) & "# And 班次 = \'中班\'"

 

http://www.foxtable.com/webhelp/scr/1337.htm