在窗口事件中 Label控件 提示代码错误
Dim y As Integer = Date.Today.Year
Dim q As Integer = (Date.Today.Month - 1) \ 3 + 1 '计算现在是第几个季度
Dim dt1 As New Date(y, 3 * (q - 1) + 1, 1) '获取本季度的第一天
Dim dt2 As New Date(y, 3 * q, Date.DaysInMonth(y,3 * q)) '获取本季度的最后一天
Dim Sum4 As Integer
With DataTables("订单明细")
Sum4 = .Compute("Sum(应收总计)" , "用车日期 >= #" & dt1 & "# And 用车日期 <= #" & dt2 & "#" ")
End With
e.Form.Controls("Label10").text = "本季度总计:" & Sum4 & "元"