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


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

主题:按时间筛选问题

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/10 12:04:00 [显示全部帖子]


Dim sf As WinForm.TextBox = e.Form.Controls("按地区查询")
Dim dwmc As WinForm.TextBox = e.Form.Controls("按单位查询")
Dim ksrq As WinForm.DateTimePicker = e.Form.Controls("起始日期")
Dim jsrq As WinForm.DateTimePicker = e.Form.Controls("结束日期")
Dim Filter As String = "1=1"
If sf.Value IsNot Nothing Then
    Filter &= " and 省份 Like '%" & sf.text & "%'"
End If
If dwmc.Value IsNot Nothing Then
    Filter &= " and 单位名称 Like '%" & dwmc.text & "%'"
End If

If ksrq.Value IsNot Nothing Then
    Filter = Filter & " and 日期 >= #" & ksrq.Value.Date & "#"
End If

If jsrq.Value IsNot Nothing Then
    Filter = Filter & " and 日期 < #" & jsrq.Value.Date.adddays(1) & "#"
End If

Tables("查询窗口_查询").Filter = filter


 回到顶部