以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 一个条件的问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=88926) |
-- 作者:douglas738888 -- 发布时间:2016/8/11 17:55:00 -- 一个条件的问题 请教老师,我写的代码,点击目录树节点,不会按条件选择,表的行都显示出来了 Dim dr As DataRow = e.Node.DataRow \'获取生成此节点的行 Dim Filter As String Filter = "上传类型_商务文件 = True" Dim Year As Integer = dr("年").Replace("年", "") Dim Month As Integer = dr("月").Replace("月", "") Dim Product As String = dr("信息编号") Select Case e.Node.Level Case 0 Filter ="Year(上传时间) = " & Year Case 1 Filter ="Year(上传时间) = " & Year & " And Month(上传时间) = " & Month Case 2 Filter ="Year(上传时间) = " & Year & " And Month(上传时间) = " & Month & " And 信息编号 = \'" & Product & "\'" End Select DataTables("查询_Table20").LoadFilter = Filter DataTables("查询_Table20").Load() 改写这样,到是可以了,不知这样写代码可对 Dim dr As DataRow = e.Node.DataRow \'获取生成此节点的行 20160810 Dim Filter As String Dim Year As Integer = dr("年").Replace("年", "") Dim Month As Integer = dr("月").Replace("月", "") Dim Product As String = dr("信息编号") Select Case e.Node.Level Case 0 Filter ="Year(上传时间) = " & Year & " And 上传类型_商务文件 = True " Case 1 Filter ="Year(上传时间) = " & Year & " And Month(上传时间) = " & Month & " And 上传类型_商务文件 = True " Case 2 Filter ="Year(上传时间) = " & Year & " And Month(上传时间) = " & Month & " And 信息编号 = \'" & Product & "\'" & " And 上传类型_商务文件 = True " End Select DataTables("查询_Table20").LoadFilter = Filter DataTables("查询_Table20").Load() [此贴子已经被作者于2016/8/11 18:02:27编辑过]
|
-- 作者:大红袍 -- 发布时间:2016/8/11 18:45:00 -- Dim dr As DataRow = e.Node.DataRow \'获取生成此节点的行
Dim Filter As String
Filter = "上传类型_商务文件 = True"
Dim Year As Integer = dr("年").Replace("年", "")
Dim Month As Integer = dr("月").Replace("月", "")
Dim Product As String = dr("信息编号")
Select Case e.Node.Level
Case 0
Filter &=" and Year(上传时间) = " & Year
Case 1
Filter &=" and Year(上传时间) = " & Year & " And Month(上传时间) = " & Month
Case 2
Filter &=" and Year(上传时间) = " & Year & " And Month(上传时间) = " & Month & " And 信息编号 = \'" & Product & "\'"
End Select
DataTables("查询_Table20").LoadFilter = Filter
DataTables("查询_Table20").Load()
|