Foxtable(狐表)用户栏目专家坐堂 → 请教老师:如何按指定日期时段进行筛选


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

主题:请教老师:如何按指定日期时段进行筛选

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


加好友 发短信
等级:六尾狐 帖子:1348 积分:9833 威望:0 精华:0 注册:2015/6/30 8:46:00
  发帖心情 Post By:2017/4/18 10:33:00 [显示全部帖子]

Dim Filter As String
Tables("进仓明细").Filter = ""
With e.Form.Controls("商品ID")
    If .Value IsNot Nothing Then
        Filter ="商品ID Like '%" & .Value & "%'"
    End If
End With
With e.Form.Controls("名称")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "名称 Like '%" & .Value & "%'"
    End If
End With

Dim jz As WinForm.DateTimePicker = e.Form.Controls("截止日期")
Dim kc As WinForm.DateTimePicker = e.Form.Controls("开始日期")

If kc.Value IsNot Nothing Then
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "日期 > '" & kc.Value & "'"
End If

If jz.Value IsNot Nothing Then
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "日期 < '" & jz.Value & "'"
End If
MessageBox.Show(filter)
If Filter > "" Then
    Tables("进仓明细").Filter = Filter
End If

 回到顶部