如果我要寻找的记录,条件为一个字段名为空,但我用select * from table where filed=''。''中间没有空格,结果是什么记录都找不到。应如何解决啊?

解决方案 »

  1.   

    isnull
    或者什么判断空的函数
      

  2.   

    select * from table where len(trim(filed))=0
      

  3.   

    select * from table where filed=''SELECT * FROM TABLE WHERE FILED IS NULL OR FILED=''
      

  4.   

    我一般是把查询的条件单独生成.
    if strtemp="" then
    strQCond = ""
    else 
    strQCond = "where field='" & strtemp & "'"
    end ifstrSql = "select * from table" & " " & strQCond要是有多个条件就一个个加,别嫌麻烦,这样对于错误处理和输入检查什么的要方便得多.
      

  5.   

    SELECT *
    FROM table
    WHERE (filed IS NULL) OR
          (filed= '')
      

  6.   

    where is null  or rtrim(ltrim(field)) = ''
      

  7.   

    select * from table where filed is null or filed = ''
      

  8.   


    select * from table where filed is null or filed = ''

    select * from table where len(trim(filed))=0
    上面两种我已经做过实验都可以