以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  一个筛选查询问题?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=43338)

--  作者:lyfxybc
--  发布时间:2013/12/4 18:24:00
--  一个筛选查询问题?
一个筛选查询问题?
代码如下:

Dim Filter As String
With
e.Form.Controls("cmbProduct")
   
If .Value IsNot Nothing Then
        Filter =
"产品 = \'" & .Value & "\'"
   
End If
End
With

With
e.Form.Controls("text1")
   
If .Value IsNot Nothing Then
       
If Filter >"" Then
            Filter = Filter &
" And "
       
End If
        Filter = Filter &
"纱支 >= #" & .Value & "#"
   
End If
End
With
With
e.Form.Controls("tex2")
   
If .Value IsNot Nothing Then
       
If Filter >"" Then
            Filter = Filter &
" And "
       
End If
        Filter = Filter &
"纱支 <= #" & .Value & "#"
   
End If
End
With

If
Filter > "" Then
    Tables(
"产品").Filter = Filter
End If



为何出现“日期”不对,纱支为数值型,如何查找数值范围内的数据(如查找某个产品,12<纱支<20内的数据)


--  作者:有点酸
--  发布时间:2013/12/4 18:26:00
--  
日期用#,字符用\',数值直接用
--  作者:lyfxybc
--  发布时间:2013/12/4 18:50:00
--  
谢谢