If User.Group = "总部" Then Dim filter As String = "1=2" For Each gs As String In DataTables("销售日报").SQLGetValues("公司") Dim maxd As Date = DataTables("销售日报").SQLCompute("max(日期)", "公司 = '" & gs & "'") filter &= " or " & "日期 = '" & maxd & "' and 公司 = '" & gs & "'" Next DataTables("销售日报").LoadFilter = filter Else Dim maxd As Date = DataTables("销售日报").SQLCompute("max(日期)", "公司 = '" & User.Group & "'") DataTables("销售日报").LoadFilter = "日期 = '" & maxd & "' and 公司 = '" & User.Group & "'" End If DataTables("销售日报").Load()
|