以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 按照时间段查询,直接要把当天的全部显示,语句怎么改呢 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=174114) |
-- 作者:wujie -- 发布时间:2022/1/1 14:02:00 -- 按照时间段查询,直接要把当天的全部显示,语句怎么改呢 Dim d1 As Datetime = e.Form.Controls("H").Value Dim d2 As Datetime = e.Form.Controls("I").Value Dim s As String = e.Form.Controls("J").Value If d1 = Nothing Or d2 = Nothing Then MessageBox.Show("日期都不能为空","友情提醒",MessageBoxButtons.OK,MessageBoxIcon.Warning) Else With DataTables("生产记录") .LoadFilter = "日期>=#" & d1 & "# and 日期 < #" & d2.adddays(1) & "#" .Load() End With Dim b As New GroupTableBuilder("统计表1",DataTables("生产记录")) b.Groups.AddDef("原料名称") b.Totals.AddDef("设定值") b.Totals.AddDef("实际值") b.Totals.AddDef("误差值") b.Build MainTable = Tables("统计表1") Tables("窗口3_Table1").DataSource = b.BuildDataSource() End If Dim g As New Subtotalgroup g.Aggregate = AggregateEnum.Sum g.GroupOn = "*" g.TotalOn = "设定值,实际值,误差值" g.Caption = "合计" With Tables("窗口3_Table1") .SubtotalGroups.Clear() .SubtotalGroups.Add(g) .Subtotal() End With
|
-- 作者:有点蓝 -- 发布时间:2022/1/3 20:29:00 -- 代码没有问题,d1\\d2输入当天的日期即可 |