以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 加载及日期代码错误 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=192374) |
-- 作者:weibu -- 发布时间:2024/6/18 18:56:00 -- 加载及日期代码错误 MainTable = Tables("rs_indepot") Dim dt As Date = Date.Today.AddDays(-450) Dim dr As DataRow = DataTables("rs_userinfo").find("sname = \'" & rsuser & "\'") \'找到当前登录者所在的行 Dim filter As String = "1=2" If dr("position") = "管理者" Then Dim drs = DataTables("rs_departinfo").Select("departno like \'" & dr("departno") & "%\'") For Each cdr As DataRow In drs Filter &= " or outdepart = \'" & cdr("depart") & "\'And rstype = \'派货\'And checkdate >= \'" & dt & "\'Or checkdate = #01/01/1900#" ‘老师这段代码是不是有问题? Next Else If dr("position") = "职员" Then Filter = "outdepart = \'" & dr("indepart") & "\'And rstype = \'派货\'And checkdate >= \'" & dt & "\'Or checkdate = #01/01/1900#" End If DataTables("rs_indepot").LoadTop = "1000" DataTables("rs_indepot").LoadOrder = "checkdate DESC" Tables("rs_indepot").OpenLoadTree("outdepart|checkdate YM|ordercode|proname",200,1000,True,Filter) ’我为了让数据加载更改高效,在Filter中添加只加载450天内的数据,请问这让是有帮助吗? 我想确认生成加载树并加载数据,添加450天内是否对加载树生成和加载数据效率有提升? Tables("rs_indepot").Sort = "checkdate DESC" Forms("派货出库汇总").Open()
|
-- 作者:有点蓝 -- 发布时间:2024/6/18 20:25:00 -- …… Dim filter As String If dr("position") = "管理者" Then Dim s As String = DataTables("rs_departinfo").GetComboListString("depart", "departno like \'" & dr("departno") & "%\'") Filter = "outdepart in (\'" & s.Replace("|", "\',\'") & "\') And rstype = \'派货\' And (checkdate >= \'" & dt & "\' Or checkdate is null)" Else If dr("position") = "职员" Then Filter = "outdepart = \'" & dr("indepart") & "\'And rstype = \'派货\' And (checkdate >= \'" & dt & "\' Or checkdate is null)" End If …… |
-- 作者:weibu -- 发布时间:2024/6/19 8:55:00 -- 老师我这样修改后,对应日期为1900-01-01的数据仍然加载不出来。而改为 Filter = "outdepart in (\'" & s.Replace("|", "\',\'") & "\') And rstype = \'派货\' And (checkdate >= \'" & dt & "\' Or checkdate = #01/01/1900#)" 又报错“#附件有语法错误,我用的是SQLserver数据库 |
-- 作者:有点蓝 -- 发布时间:2024/6/19 9:00:00 -- http://www.foxtable.com/webhelp/topics/2343.htm |