日期:2014-05-17  浏览次数:20924 次

组合查询怎样做比较好?
从多个字段中任意选取若干个进行查询,怎样做较好?
请各位帮忙,谢谢!

------解决方案--------------------
Sql = "Select * From [table_name] Where 1=1 "
if Request( "field1 ") <> " " then
Sql = Sql & " and field1= ' " & Request( "field1 ") & " ' "
End If

if Request( "field2 ") <> " " then
Sql = Sql & " and field2= ' " & Request( "field2 ") & " ' "
End If
……