那么在實(shí)際中如何來(lái)實(shí)現這樣的多條件模糊查詢(xún)呢?我是這樣來(lái)實(shí)現的:
name=Request.QueryString("name") ’姓名
sex=Request.QueryString("sex") ’性別
call=Request.QueryString("call") ’電話(huà)
Sql= "Select * from 表名 where 1=1" ’1=1 避免所有查詢(xún)字段為空時(shí)出錯
if name <>"" then
Sql= Sql & "and 姓名 like ’%"& name &"%’"
end if
if sex <>"" then
Sql= Sql & "and 性別 = ’"& sex &"’" ’這個(gè)不是模糊查詢(xún)了
&n
聯(lián)系客服