AdoTable1.filter:='(idno4=1) or (idno4=1) and (idno=3)'

解决方案 »

  1.   

    AdoTable1.filter:='(idno4=1) or (idno4=1) and (idno4=3)'
    对不起,应该是这个
      

  2.   

    AdoTable1.filter:='idno='+(idno4=1) or (idno4=1) and (idno4=3)'
      

  3.   

    idno4是什么?变量吗还是本身的字段?
    有可能是你的filtered的属性问题吧
      

  4.   

    and操作符优先于or,于是你只能找出
    (idno4=1) and (idno=3)这样的数据,加个()试试
      

  5.   

    没讲清楚。
    idno4是字段名。
      

  6.   

    AdoTable1.filter:='idno4='+IntTostr(1)+' or idno4='+inttostr(1)+' and idno4='+inttostr(3);
      

  7.   

    '(idno4=1) or (idno4=1) and (idno=3)'or 和 and 好象不能同级出现的( (idno4=1) and (idno=3)  ) or (idno4=1)
      

  8.   

    JavaD 说的对,and 优先于 or , 
    '(idno4=1) or (idno4=1) and (idno4=3)' 
    相当于(应该是)
    '(idno4=1) or ((idno4=1) and (idno4=3))',
    (如果“要追究结果怎么”的话,因为同一条记录中的idno4不可能既等于1又等于3,所以肯定是没有结果)
      

  9.   

    这样写很不好,楼上的用括号就很不错,使用or。跟and是在一遍出现真或假,就不会执行另一遍,很可能会导致想的跟写的不一样
      

  10.   

    请教大邦兄弟:
    AdoTable1.filter:='idno4='+IntTostr(1)+' or idno4='+inttostr(1)+' and idno4='+inttostr(3);
    是否和
    AdoTable1.filter:='(idno4=1) or (idno4=1) and (idno4=3)';
    一样