if (RadioButton4.Checked= True ) then
      begin
         table1.Close;
         table1.Filter:=' ShopId >='+edit2.Text+' and ShopId =<'''+edit3.Text+''''+'and  State=''营业''';
         table1.Filtered:=true;
         table1.Open;
         if table1.RecordCount=0 then
         begin
            showmessage('抱歉,没有你要找的序列号!!!');
            table1.Close ;
            table1.Filter:=' ShopId <>NULL';
            table1.Filtered:=true;
            table1.Open ;
         end;
      end;

解决方案 »

  1.   

    table1.Open;
    if RadioButton4.Checked then
    begin
      table1.Filter:='ShopId >='+Quotedstr(edit2.Text)+' and ShopId <='+Quotedstr(edit3.Text)+' and State=''营业''';
      table1.Filtered:=true;
      if table1.RecordCount=0 then
      begin
        showmessage('抱歉,没有你要找的序列号!!!');
        table1.Filtered:=false;
      end;
    end;
      

  2.   

    table1.Open;
    if RadioButton4.Checked then
    begin
      table1.Filter:='ShopId >='+Quotedstr(edit2.Text)+' and ShopId <='+Quotedstr(edit3.Text)+' and State=''营业''';
      table1.Filtered:=true;
      if table1.RecordCount=0 then
      begin
        showmessage('抱歉,没有你要找的序列号!!!');
        table1.Filtered:=false;
      end;
    end;
      

  3.   

    table1.Open;
    if RadioButton4.Checked then
    begin
      table1.Filter:='ShopId >='+Quotedstr(edit2.Text)+' and ShopId <='+Quotedstr(edit3.Text)+' and State=''营业''';
      table1.Filtered:=true;
      if table1.RecordCount=0 then
      begin
        showmessage('抱歉,没有你要找的序列号!!!');
        table1.Filtered:=false;
      end;
    end;
      

  4.   


    if (RadioButton4.Checked= True ) then
    begin
      table1.Close;
      {其实用下面这个感觉比较清晰
      table1.Filter:=format('(ShopId >= %s) and (ShopId =< %s) and (State="营业")', [edit2.Text, edit3.Text]);}
      table1.Filter:='(ShopId >= '+edit2.Text+') and (ShopId =<'+edit3.Text+') and (State="营业")';
      table1.Filtered:=true;
      table1.Open;
      if table1.RecordCount=0 then
      begin
        showmessage('抱歉,没有你要找的序列号!!!');
        table1.Close ;
        table1.Filter:=' ShopId <>NULL';
        table1.Filtered:=true;
        table1.Open ;
      end;
    end;
      

  5.   


    if (RadioButton4.Checked= True ) then
    begin
      table1.Close;
      {其实用下面这个感觉比较清晰
      table1.Filter:=format('(ShopId >= %s) and (ShopId =< %s) and (State="营业")', [edit2.Text, edit3.Text]);}
      table1.Filter:='(ShopId >= '+edit2.Text+') and (ShopId =<'+edit3.Text+') and (State="营业")';
      table1.Filtered:=true;
      table1.Open;
      if table1.RecordCount=0 then
      begin
        showmessage('抱歉,没有你要找的序列号!!!');
        table1.Close ;
        table1.Filter:=' ShopId <>NULL';
        table1.Filtered:=true;
        table1.Open ;
      end;
    end;
      

  6.   

    晕,ShopId到底是什么类型的啊?难道不是Integer吗?
    怎么还有ShopId <> NULL...