access里查询条件满足字符串
这里有个字符串aa= "1|2|3|4|5|6 "
请问 怎么实现查询 id=1 and id=2...id=6这样的循环?
------解决方案--------------------[个人意见,仅供参考]
试一试
<%
aa= "1|2|3|4|5|6 "
dim arr : arr = split(aa, "| ")
dim sql : sql = "select * from [yourtable] where iid =
"+arr(0)+ " "
dim i: i=1
while i <=ubound(arr)
sql = sql + " or iid= " + arr(i)
i = i+1
wend
response.write sql
%>