有四个选项分别是bsSkinEdit1.Text、bsSkinEdit2.Text、开始时间ksdate、结束时间jsdate,  xj(string型);这四个条件都不是必选项.数据库是Access. 如何写查询语句呢?

解决方案 »

  1.   

    用个变量 附值 这些 条件就可以了啊 `~~
    如:strwhere :=' 1=1 ';
        ……
      if 1被选种 then
        strwhere :=strwhere+' and '+bsSkinEdit1.Text
    ^^ 类推。========
    http://topic.csdn.net/u/20071031/16/1c4fa059-3d8a-46b1-b484-7bbc80ff3149.html
    有谁能帮我 解决下偶的问题 啊~~“高”分
      

  2.   

    “'”怎么变了……-—_—-
    把“'” 改成“'” 
      

  3.   

    kao !
    " '' “ @' @'' /'  /''  /"
      

  4.   

    不要转义啊~~~论坛。用个变量   附值   这些   条件就可以了啊   `~~ 
    如:strwhere   := '   1=1   '; 
            …… 
        if   1被选种   then 
            strwhere   :=strwhere+ '   and   '+bsSkinEdit1.Text 
    ^^   类推。