这是我两年前学着写的代码,同季。
Dim a As Date = Tables("订单").Current("日期")
Dim b As Integer = (a.Month-1) \ 3
Dim c As New Date(a.Year,b*3+1,1)
Dim d As New Date(a.Year,b*3+3,Date.DaysInMonth(a.year,b*3+3))
Tables("订单").Filter = "[日期] >= #" & c & "# And 日期 <= # "& d &"#"
同周。
Dim a As Date = Tables("订单").Current("日期")
Dim b As Date
a = a.AddDays(-a.dayofweek+1)
b = a.AddDays(-a.dayofweek+7)
Tables("订单").Filter = "[日期] >= #" & a & "# And 日期 <= # "& b &"#"
[此贴子已经被作者于2010-10-9 9:44:19编辑过]