记录集中字段如下形式 %,quality#20041200,% 和%,quality,%
如何过滤掉含#的纪录?
这样写为什么不行? rs.filter:='field<>''*#*''';

解决方案 »

  1.   

    //try this:rs.filter:='field not like ''%#%''';
      

  2.   

    rs.Filter:='field not like ''%'#'%'' ' 或者
    rs.filter:='field<> ''%'#'%'' '
    你试试看
      

  3.   

    试了好多,我没做出来,
    觉得实现不了,我的理由是 fielder中不能包含 like 或者not like 的谓词,而你要过滤的字段中包含了#,那么就要用到%或者_,但%和_必须和like或者 not like连接起来使用,所以我觉得不可以,也不知道其他高手能不能做出来,帮你up
    实在不行你看看能不能使用
      query1.Close;
      query1.SQL.Clear;
      query1.SQL.Add('select * from ××× where name not like ''%#%''  ');
      query1.Open;