以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  筛选日期  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=116395)

--  作者:yifan3429
--  发布时间:2018/3/23 18:58:00
--  筛选日期
筛选

For Each dr As DataRow In DataTables("工作日报").sqlSelect("[部门] = \'营销部\'and "日期 = #" & Date.Today-2 & "#"", "", "日期 Desc")

筛选出 营销部 最近 2 天的内容

--  作者:wyz20130512
--  发布时间:2018/3/23 20:23:00
--  
For Each dr As DataRow In DataTables("工作日报").SQLSelect("[部门] = \'营销部\' And [日期] In (#" & Date.Today & "#,#" & Date.Today.AddDays(-1) & "#)")

若后台数据库为MSsql,则将其中的#号替换为\'
[此贴子已经被作者于2018/3/23 20:25:52编辑过]

--  作者:有点蓝
--  发布时间:2018/3/23 20:47:00
--  
For Each dr As DataRow In DataTables("工作日报").sqlSelect("[部门] = \'营销部\'and "日期 >= #" & Date.Today.AddDays(-1) & "#"", "", "日期 Desc")
--  作者:yifan3429
--  发布时间:2018/3/25 18:46:00
--  
---------------------------
错误
---------------------------
编译错误:应为逗号、“)”或有效的表达式继续符。



错误代码:For Each dr As DataRow In DataTables("工作日报").sqlSelect("[部门] = \'木作事业部\'and "日期 >= \'" & Date.Today.AddDays(-1) & "\'"", "", "日期 Desc")
---------------------------
确定   
---------------------------


--  作者:有点甜
--  发布时间:2018/3/25 21:12:00
--  

参考代码

 

For Each dr As DataRow In DataTables("工作日报").sqlSelect("[部门] = \'营销部\' and 日期 >= #" & Date.Today.AddDays(-1) & "#", "", "日期 Desc")