以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]按时段加载数据,报错 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=174396) |
-- 作者:foxtablefanse -- 发布时间:2022/1/13 15:55:00 -- [求助]按时段加载数据,报错 \'加载近三个月数据 \'Dim y As Integer = Date.Today.Year \'Dim m As Integer = Date.Today.Month - 2 \'Dim dt1 As New Date(y,m,1) \'Dim dt2 As Date=Date.Today() \'Dim Filter As String ="统计月 >= \'" & dt1 & "\' And 统计月 <= \'" & dt2 & "\'" 感觉写法没问题啊??
[此贴子已经被作者于2022/1/13 15:55:08编辑过]
|
-- 作者:foxtablefanse -- 发布时间:2022/1/13 16:00:00 -- Dim m As Integer = Date.Today.Month - 2 这个有问题,小于3月时成负数了 |
-- 作者:cd_tdh -- 发布时间:2022/1/13 16:14:00 -- Dim dt As Date = Date.Today.AddMonths (-3)
[此贴子已经被作者于2022/1/13 16:15:03编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/1/13 16:47:00 -- http://www.foxtable.com/webhelp/topics/1337.htm |
-- 作者:foxtablefanse -- 发布时间:2022/1/13 19:49:00 -- 谢谢,我最终采用了ms sql的写法,filter="DateDiff(m,统计月,GetDate()) < 3" 感觉更简洁些 [此贴子已经被作者于2022/1/13 19:50:55编辑过]
|