老师好!拼接3个筛选字符串,第一个里面包含“or”,其他都是“and”,这种拼接应该怎么办?
谢谢!
'旧存条件1
Dim Filter3 As String = "1=1"
Dim y As String = e.Form.Controls("CheckedComboBox年度").text
If y <> "" Then
Dim dt1 As New Date(CInt(y), 1, 1)
Dim dt2 As New Date(CInt(y), 12, 31)
Filter3 &= " and 立案日期 < '" & dt1 & "' And 结案日期 >= '" & dt1 & "' Or 立案日期 < '" & dt1 & "' And 结案日期 Is Null" ’去年收案,今年结案或未结的
End If
'条件2
Dim Filter0 As String = "1=1"
With e.Form.Controls("CheckedComboBox地区")
If .Value IsNot Nothing Then
Filter0 &= " and 地区 in ('" & .Text.Replace(",", "','") & "')"
End If
End With
'条件3
Dim Filter00 As String = "1=1"
With e.Form.Controls("CheckedComboBox审判程序")
If .Value IsNot Nothing Then
Filter00 &= " and 审判程序 in ('" & .Text.Replace(",", "','") & "')"
End If
End With
Filter = Filter3 & Filter0 & Filter00----?