想搜索这样的记录,打个比方,表为res,其中有一字段为res_num,想要搜索res_num
字段为"11"开头的所有记录,该怎么写,谢谢!
??"select * from res where res_num like 该写什么"

解决方案 »

  1.   

    strsql="select * from res where res_num like" & "11*"
      

  2.   

    strsql="select * from res where res_num like '11%'"
      

  3.   

    str="11"
    strsql="select * from res where res_num='" & str & "'"
      

  4.   

    str="11%"
    strsql="select * from res where res_num='" & str & "'"
      

  5.   

    纠正一下:
    strsql = "select * from res where res_num like '" &  "11*'"
    动态的查询这样写:
    dim yournum as string
    strsql = "select * from res where res_num like'%" & yournum & "%'"
    '包含字符串的写法