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;
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;
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;
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;
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;
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;
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;
怎么还有ShopId <> NULL...