http://bbs.2ccc.com/attachments/tq84_200512312640.jpg
下拉菜单的这种。给几个例子吧,特别是“like”这一段 
like那是个combobox框,还有其他的:
like
=
>
<
这四个选项 
============================
请给几个例子

解决方案 »

  1.   

    在combobox的items中加入
    like
    =
    >
    <
    就可以了!
      

  2.   

    字符串相加:
    declare @sql varchar(3000),@flag varchar(20)
    set @flag='like'
    set @sql='select * from test where job_id '+@flag+'''%1%'''exec(@sql)
      

  3.   

    我做的是access数据库
    wozhuchuanwei(一个组件编写者,就一定是一个更优秀的Delphi开发者)理解错我的意思了。呵呵。我是想在用户可以通过两个combobox选择条件查询。
      

  4.   

    还是一样啊,楼主:
    var
    sql string;
    begin
    sql:string;
    begin
    sql:='select * from test where job_id '+combobox1.Text+'''%1%''';
    adoquery1.sql.text:=sql;
    end;
    写成类似于上面,sql字符串相加
      

  5.   

    对不起,我不太理解:
    有2个combobox:
    sql:='select * from test where job_id '+combobox1.Text+'''%1%''';
    中的:
    '''%1%'''中的1是什么`?
      

  6.   

    '''%1%'''中的1是什么`?
    ------------------------------
    我想指的是combobox1.text里面包含“1”
      

  7.   

    试一试:
    sql.add('select * from tablename where ');
    sql.add(combobox1.text+' '+combobox2.text);
    sql.add( ''+edit1.text+'');
      

  8.   

    ---------------------------
    Debugger Exception Notification
    ---------------------------
    Project Project1.exe raised exception class EOleException with message '标准表达式中数据类型不匹配。'. Process stopped. Use Step or Run to continue.
    ---------------------------
    OK   Help   
    ---------------------------
    因为like里要带%,怎么回事?
      

  9.   

    加上这些符号有什么用,使用的人知道是什么吗?like应该表示为"模糊"查找等等,要考虑用户是一个不会编程的人!~~~~~