代码:
Dim DayTime As Date = #02/01/2023 00:00:01#
Dim Endtime As Date = #03/01/2023 00:00:01#
Dim shopName As String = "天行店"
Dim jb As New SQLJoinTableBuilder("业绩查询","权限设置")
jb.C
jb.AddTable("权限设置","id","零售总表","收银员ID")
jb.AddExp("收银员ID", "id",True)
jb.AddCols("账号名",True)
jb.AddExp("日", "Day(日期)",True)
jb.AddExp("业绩", "Sum(业绩)")
jb.AddExp("利润", "Sum(利润)")
jb.AddExp("营业额", "Sum(实际支付)")
jb.Filter = "日期 > '" & DayTime & "' and 日期 < '" & Endtime & "' and 支付方式 <> '' and {零售总表}.店名 = '" & shopName & "'"
jb.Distinct = True
jb.Build()
MainTable = Tables("业绩查询")