Foxtable(狐表)用户栏目专家坐堂 → 时间加列名筛选


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

主题:时间加列名筛选

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


加好友 发短信
等级:二尾狐 帖子:573 积分:2961 威望:0 精华:0 注册:2016/10/27 14:33:00
  发帖心情 Post By:2016/11/21 9:01:00 [显示全部帖子]

Dim d1 As Date = e.Form.Controls("DateTimePicker1").Value
If d1 = Nothing Then d1 = Date.Today
Dim filter1 As String = "1=1"
If e.Form.Controls("RadioButton1").Checked Then
    filter1 = " and 发货_日期 = #" & d1 & "#"
ElseIf e.Form.Controls("RadioButton2").Checked Then
    Dim w As Integer = d1.DayOfWeek '算出今天是星期几
    Dim dt1 As Date = d1.AddDays(0 - w) '获取本周的第一天 ,星期一到星期天
    Dim dt2 As Date = d1.AddDays(6 - w) '获取本周的最后一天
    filter1 = " and 发货_日期 >= #" & dt1 & "# and 发货_日期 <= #" & dt2 & "#"
End If
If e.form.Controls("ComboBox2").Text > "" Then
    filter1 = filter1 & " And 目录_订单= '" & e.form.Controls("ComboBox2").Text & "'"
End If
Tables("订单").Filter = filter1

 回到顶部