djj为 tadoquery
========djj.Close;
djj.SQL.Clear;
djj.SQL.Add('select * from t_djj');
djj.sql.Add('where (代理点='''+edit4.Text+''')');
djj.SQL.add('and (重量1<:zl1)');
djj.sql.add('and (重量2 >:zl1)');
djj.Parameters.ParamByName('zl1').Value:=strtofloat(edit10.Text);
djj.open;
edit1.Text:=floattostr(djj.fieldbyname('价格').AsFloat);
========djj.Close;
djj.SQL.Clear;
djj.SQL.Add('select * from t_djj');
djj.sql.Add('where (代理点='''+edit4.Text+''')');
djj.SQL.add('and (重量1<:zl1)');
djj.sql.add('and (重量2 >:zl1)');
djj.Parameters.ParamByName('zl1').Value:=strtofloat(edit10.Text);
djj.open;
edit1.Text:=floattostr(djj.fieldbyname('价格').AsFloat);
begin
close;
sql.clear;
sql.text := 'select * from t_djj where (代理点 = :1 ) and ' +
'(:zll between .. and ..)';
parameters.ParamByName('1').Value:= edit4.text;
parameters.ParamByName('zl1').Value:=strtofloat(edit10.Text);open;edit1.text := fieldbyname('价格').Asstring;
end;
BETWEEN和IN很常用的