以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]datetime列筛选 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=154031) |
-- 作者:天一生水 -- 发布时间:2020/9/1 16:48:00 -- [求助]datetime列筛选 老师好! 如果是日期时间列,昨天8月31日筛选本月(8月)时,最后一天(图中8月31日的)不显示。今天9月1日又筛选本月,8月31日的也没到9月里面,是什么原因? 代码: Dim
y As Integer = Date.Today.Year Dim m As Integer = Date.Today.Month Dim dt1 As New Date(y, m, 1) Dim dt2 As New Date(y, m, Date.DaysInMonth(y, m)) \'获取本月的最后一天 Dim Filter As String Filter = "申报时间 >= #" & dt1 & "# And 申报时间 <= #" & dt2 & "#" Tables("申报编辑_table1").Filter = Filter |
-- 作者:有点蓝 -- 发布时间:2020/9/1 16:54:00 -- Dim y As Integer = Date.Today.Year Dim m As Integer = Date.Today.Month Dim dt1 As New Date(y, m, 1) Dim Filter As String Filter = "申报时间 >= #" & dt1 & "# And 申报时间 < #" & dt1.addyears(1) & "#" Tables("申报编辑_table1").Filter = Filter |