不应该这个问题呀
Dim y As Integer = Date.Today.Year
Dim dt1 As New Date(y, 1, 1)
Dim dt2 As New Date(y, 12, 31)
Dim Filter As String = "1=1"
If Vars("开始日期") IsNot Nothing And Vars("结束日期") IsNot Nothing Then
Filter = "录入时间 >= '" & Vars("开始日期") & "' And 录入时间 <= '" & Vars("结束日期") & "'"
Else
Filter = "录入时间 >= '" & dt1 & "' And 录入时间 <= '" & dt2 & "'"
End If
Dim nms As String
Dim nmsx As String
Dim drs As List(of DataRow) = DataTables("查询权限").SQLSelect("管理员ID = '" & _UserID & "'")
If drs.Count > 0 Then
For Each dr As DataRow In drs
nms = nms & ",'" & dr("查询单位") & "'"
Next
For Each dr As DataRow In drs
nmsx = nmsx & ",'" & dr("查询部门") & "'"
Next
End If
If nmsx > "" And nms > "" Then
nms = nms.Trim(",")
nmsx = nmsx.Trim(",")
Filter = Filter & " And " & "报表名称 Like '%" & e.node.Name & "%' And 纳税人识别号='" & e.Node.ParentNode.Name & "'And 主管税务机关 In (" & nms & ") And 主管部门 In (" & nmsx & ")"
End If
Tables(e.Form.Name & "_Table1").Fill("select* from{企业所得税税收优惠备案管理台账} Where " & Filter ,"服务器",True)