以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]查询代码好像有问题,查出来不对  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=118026)

--  作者:静听枫雨
--  发布时间:2018/4/23 16:55:00
--  [求助]查询代码好像有问题,查出来不对

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20180423165505.png
图片点击可在新窗口打开查看


Dim Filter As  new List(of String)
Dim ComboBox1 As String =  e.Form.Controls("客户名称").text
Dim ComboBox2 As String =  e.Form.Controls("付款状态").text
Dim sst As String =  e.Form.Controls("开始日期").text
Dim est As String =  e.Form.Controls("结束日期").text
If ComboBox1  > "" Then Filter.add("客户名称 like \'%" & ComboBox1  & "%\' Or 业务员 Like \'%" & ComboBox1  & "%\'")
If ComboBox2  > "" Then Filter.add("付款状态 like \'%" & ComboBox2  & "%\'")
If sst > "" Then Filter.add("订单日期 >=  #" & sst & "# ")
If est > "" Then Filter.add("订单日期 <=  #" & est & "# ")
Tables("订单表").Filter = String.Join(" and ",Filter.ToArray())


--  作者:有点甜
--  发布时间:2018/4/23 18:59:00
--  

If ComboBox1 > "" Then Filter.add("客户名称 like \'%" & ComboBox1  & "%\' Or 业务员 Like \'%" & ComboBox1  & "%\'")

 

改成

 

If ComboBox1  > "" Then Filter.add("(客户名称 like \'%" & ComboBox1  & "%\' Or 业务员 Like \'%" & ComboBox1  & "%\')")