Foxtable(狐表)用户栏目专家坐堂 → 有个比较复杂的筛选请大师指点


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

主题:有个比较复杂的筛选请大师指点

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


加好友 发短信
等级:狐神 帖子:4773 积分:34673 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2014/4/13 13:41:00 [显示全部帖子]

Dim cp As WinForm.ComboBox = e.Form.Controls("product")
Dim sd As WinForm.DateTimePicker = e.Form.Controls("startDate")
Dim ed As WinForm.DateTimePicker = e.Form.Controls("EndDate")
Dim s1,s2,s3 As String
s1 = "付款时间>=#" & sd.Value & "# And 付款时间<=#" & ed.Value & "# And 订单状态='已收货' And 产品名称='" & cp.Value & "'"
s2 = "付款时间>=#" & sd.Value & "# And 付款时间<=#" & ed.Value & "# And 订单状态='已退货' And 退款时间<#" & sd.Value & "# or 退款时间>#" & ed.Value & "# And 产品名称='" & cp.Value & "'" 
s3 = "退款时间>=#" & sd.Value & "# And 退款时间<=#" & ed.Value & "# And 订单状态='已退货' And 付款时间<#" & sd.Value & "# or 付款时间>#" & ed.Value & "# And 产品名称='" & cp.Value & "'"
Tables("表A").Filter = s1 & " Or " & s2 & " Or " & s3

 回到顶部