Foxtable(狐表)用户栏目专家坐堂 → 筛选问题


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

主题:筛选问题

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110790 积分:563882 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/8/13 14:47:00 [显示全部帖子]

这里日期使用模糊查询没有意义

Dim filter As String
Dim sts () As String = {"客户","订单号码","销售员","客户订单"}
For Each st As String In sts
    Dim val As String = e.Form.Controls(st).value
    If val > "" Then '如果不是空
        Val = val.replace("*","[*]") '把"*" 符号变成字符才能使用
        If filter = "" Then
            filter = st & " like '*" & val & "*'"
        Else
            filter = filter & " and " & st & " like '*" & val & "*'"
        End If
    End If
Next

With e.Form.Controls("开始日期")
    
If .Value IsNot Nothing Then
        
If Filter >"" Then
            Filter = Filter & 
" And "
        
End If
        Filter = Filter & 
"开始日期 >= #" & .Value & "#"
    
End If
End
 With
……

 回到顶部