Foxtable(狐表)用户栏目专家坐堂 → 筛选订单日期如何可以安年月筛选


  共有3565人关注过本帖树形打印复制链接

主题:筛选订单日期如何可以安年月筛选

帅哥哟,离线,有人找我吗?
有点色
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/16 17:52:00 [显示全部帖子]

Dim filter As String
With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("DateTimePicker2")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 <= #" & .Value & "#"
    End If
End With

Dim bd1 As New GroupTableBuilder("统计表1",DataTables("订单"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("客户编号")
bd1.Totals.AddDef("数量","总数量") '对数量进行统计
bd1.Totals.AddDef("金额","总")
bd1.Filter = filter
bd1.Totals.AddDef("金额",AggregateEnum.Min,"最小值")
dt1 = bd1.BuildDataSource()
Dim t As Table = Forms("窗口2").controls("Table1").Table
t.DataSource = dt1 '将统计结果绑定到Table


 回到顶部