Query1.SQL.Clear;
Query1.SQL.Add('Select * From Task');
Query1.SQL.Add('Where (地点 = ''' + ComboBox1.Text + ''') '
             + '  and (任务性质 = ''' + ComboBox2.Text + ''')');
Query1.Open;

解决方案 »

  1.   

    第二次查询时把所有条件加上就行了:
    Query1.SQL.Clear;
    Add('select * from task where 地点='''+combobox1.Text+ '' and  ' 
    +  '任务性质='''+combobox2.text+'''');—————————————————————————————————
    MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
                 毁誉由人,望天上云卷云舒,聚散任风。';
    if Not Assigned(I) then
      I := TI.Create(Nil);
    I.Maxim := MaximStr;
    I.Explain := '假如上述代码中出现“OA”等字样,删除它们';
    I.Desire := '加不加分随你';
    —————————————————————————————————
           
      

  2.   

    'select * from task where 地点='''+combobox1.Text+ ''' and  ' 
    +  '''任务性质='''+combobox2.text+'''');
    条件合起来就可以了!
      

  3.   

    我还想问问,为什么Query1.SQL.Add('select * from task where 任务性质='''+combobox2.text+'''');语句的格式是这样的呢??能否解释一下??尤其是where后的变量引用的时候
      

  4.   

    Query1.SQL.Add('select * from task where 任务性质= :value;
    query1.Params.items[0].asstring := combobox2.text;