谢谢“有点蓝”老师 和 “dzy1232016” !
在两位的启发下,已解决。还是动态合成表达式没有掌握好。
Dim xmbm As String = Tables("查询条件").Current("项目编码")
Dim ksny As String = Tables("查询条件").Current("开始年月")
Dim jzny As String = Tables("查询条件").Current("截止年月")
Dim kmbm As String = DataTables("项目科目").GetComboListString("科目编码","[显影] = 'false'")
Output.Show(xmbm)
Output.Show(ksny)
Output.Show(jzny)
Output.Show(kmbm)
kmbm = kmbm.Replace("|","','")
Output.Show(kmbm)
Tables("凭证").Filter = "[项目编码] = '" & xmbm & "' and [制单日期] >= '" & ksny & "' and [制单日期] <= '" & jzny & "' And [科目编码] not In ('" & kmbm & "')"
返回数据:
3002
2019-02-01
2019-08-31
112301|112303|220202|220204
112301','112303','220202','220204
[此贴子已经被作者于2019/10/30 14:22:01编辑过]