strSQL = " select * from tblcpzl where " & strFileName & " like '" * " & " & Me.cxnr & " & " * "'" & _
                 " order by cpzlid"

解决方案 »

  1.   

    我是想弄一个模糊查询,所以在Me.cxnr两边想加"*"上去,但不知道怎么加。请求帮助
      

  2.   

    这个绝对是SQL 语句啊我来简化一下" select * from tblcpzl where " & strFileName & " like '" * " & " & Me.cxnr & " & " * "'"
      

  3.   

    如果在sql server里执行,要写成下面那样,用%表示模糊的内容不知道你加*是干什么,难道在access里执行" select * from tblcpzl where " & strFileName & " like '%* " &  Me.cxnr & "*%'"
      

  4.   

    下面这个是出现错误的语句:" select * from tblcpzl where 产品名称 like '" * " & " & Me.cxnr & " & " * "'"下面这个是正确的语句,但是没有"*"" select * from tblcpzl where 产品名称 like '" & Me.cxnr & "'"我想建立一个模糊查询,就想到了 like *某某产品* 的形式,请帮忙改一下第一句。
      

  5.   

    根据xys_777启发,正觉答案是:
    " select * from tblcpzl where 产品名称 like '*" & Me.cxnr & "*'"