请教 如何取前日期的前一年?Dim Filter As String
Dim y As Integer = Date.Today.Year
Dim m1 As Integer = Date.Today.Month-12
Dim m As Integer = Date.Today.Month
Dim dt1 As New Date(y, m1, 1)
Dim dt2 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
e.Form.Controls("startdate").value=Dt1
e.Form.Controls("enddate").value=Dt2
e.Form.Controls("startdate").value=Dt1
e.Form.Controls("enddate").value=Dt2
Filter ="订单日期 >= '" & dt1 & "' And 订单日期 <= '" & dt2 & "'"
'Filter ="日期 >=#" & dt1 & "# And 日期 <=#" & dt2 & "#" & "and 单据状态='已审核'"
With DataTables("订单")
.LoadFilter = filter
.Load()
End With
这样写对吗
[此贴子已经被作者于2023/5/29 13:57:35编辑过]