这样试试
Dim r As Row = CurrentTable.Current Dim Dt,StartDate,EndDate As Date Dim Sum As Double Dt = r("日期") If r.IsNull("日期") Then StatusBar.Message1= "" Else StartDate = New Date(Dt.Year,Dt.Month,1) EndDate = New Date(Dt.Year,Dt.Month,Date.DaysInMonth(Dt.Year,Dt.Month)) Sum = DataTables("订单").Compute("Sum(数量)","[日期] >= #" & StartDate & "# And [日期] <= #" & EndDate & "#") StatusBar.Message1= "本月总计数量: " & Math.Round(Sum,3) End If
|