我的查询条件是(a or b) and c
我试过不少种写法,多总是报格式不对的错误为什么?怎样才是正确的写法?
我试过下面几种写法:
一,table.filter:='(a'+' or '+'b)'+' and '+c
二,table.filter:=(a+' or '+b)+' and '+c
三。table.filter:=((a)+' or '+(b))+' and '+c
...

解决方案 »

  1.   

    试试看。
    (a and c) or (b and c)
      

  2.   

    一,table.filter:='字段名='+'(a'+' or '+'b)'+' and '+c
    二,table.filter:='字段名='+(a+' or '+b)+' and '+c
    三。table.filter:='字段名='+((a)+' or '+(b))+' and '+c
      

  3.   

    我没有说清楚,a、b、c为三个表达式,里面已经各含有字段了
      

  4.   

    a:='字段名='+quotedstr(值或变量)
      

  5.   

    楼主用得着写这么多加号吗??
    就像SQL语句一样就OK啦!