代码如下,将帮忙代码等于改为like,下面代码只生效一个条件,不能多条件复合筛选,请教老师代码错在哪里
Dim flt As String
If e.PostValues.ContainsKey("商品ID") Then
flt = "商品ID like '%" & e.PostValues("商品ID") & "%'"
End If
If e.PostValues.ContainsKey("名称") Then
If flt > "" Then
flt = flt & " and "
End If
flt = "名称 like '%" & e.PostValues("名称") & "%'"
End If
If e.PostValues.ContainsKey("品牌") Then
If flt > "" Then
flt = flt & " and "
End If
flt = "品牌 like '%" & e.PostValues("品牌") & "%'"
End If
数据库省略
If flt > "" Then
cmd.CommandText = cmd.CommandText & " where " & flt
End If