Foxtable(狐表)用户栏目专家坐堂 → 一个条件的问题


  共有1857人关注过本帖树形打印复制链接

主题:一个条件的问题

帅哥,在线噢!
douglas738888
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1174 积分:8782 威望:0 精华:0 注册:2012/4/18 16:28:00
一个条件的问题  发帖心情 Post By: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编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By: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()

 回到顶部