以文本方式查看主题

-  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=84722)

--  作者:luckier
--  发布时间:2016/5/9 10:40:00
--  [求助]时间段内查询问题
比如查找时间为2016-5-8到2016-5-9的内容,

我用的是:Syscmd.Filter.Between()       这个命令,

但是只有2016-5-8的内容,2016-5-9的内容不显示


怎么办????才能让2016-5-9的内容也一起显示


谢谢!!!!!!!!!!!!!!!!!!!!

--  作者:大红袍
--  发布时间:2016/5/9 10:47:00
--  

你的日期应该是包括了时间的,日期设置成小于 2016-5-10 才行。

 

但是系统命令没有考虑到这个,你要自己做一个窗口 http://www.foxtable.com/help/topics/1058.htm

 

 

 


--  作者:luckier
--  发布时间:2016/5/9 10:47:00
--  
没人回复吗?救急啊
--  作者:大红袍
--  发布时间:2016/5/9 11:17:00
--  
2楼就是答案啊
--  作者:luckier
--  发布时间:2016/5/9 11:30:00
--  
能具体点吗?我还是不太明白。

还是没法把符合条件的表格内容筛选出来


我想在一个独立的窗口中体现出来查询的结果。。。。。。
--  作者:大红袍
--  发布时间:2016/5/9 11:33:00
--  

 叫你筛选8号到10号的数据啊。

 

 如果10号的数据也出来了,再把10号的数据排除掉。

 

 ----------------

 

 方法二,去写代码 http://www.foxtable.com/help/topics/1058.htm


--  作者:luckier
--  发布时间:2016/5/9 14:51:00
--  
我不知道哪里出了问题????能帮看看吗?
CurrentTable.Select(0,5) 
Tables("病患信息").ApplyFilter = False
Dim Filter As String
With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 <= #" & .Value & "#"
    End If
End With
Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1")
txt.Value=Tables("病患信息").Rows.Count
图片点击可在新窗口打开查看

--  作者:大红袍
--  发布时间:2016/5/9 14:56:00
--  

Dim Filter As String
With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 < #" & .Value.AddDAys(1) & "#"
    End If
End With

 

Tables("病患信息").Filter = Filter

 


Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1")
txt.Value=Tables("病患信息").Rows.Count