以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]拼接筛选字符串 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=166078) |
-- 作者:天一生水 -- 发布时间:2021/5/17 16:16:00 -- [求助]拼接筛选字符串 老师好! 拼接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----? |
-- 作者:有点蓝 -- 发布时间:2021/5/17 16:31:00 -- Filter3 &= " and (立案日期 < \'" & dt1 & "\' And 结案日期 >= \'" & dt1 & "\' Or 立案日期 < \'" & dt1 & "\' And 结案日期 Is Null)" |