Lo que debes hacer es lo siguiente:
utilizar un componente TQuery, y en el evento Onclick de tu botón colocar lo siguiente:
with Query1 do
begin
SLQ.Close;
SQL.Clear;
SQL.Add('select count (num_decimo) as totalReg from reserva');
SQL.Add('where num_sorteo=:num_sorteo2');
ParambyName('num_sorteo2').AsInteger:=StrtoInt(Edit1.Text); //La funcion StrtoInt( ) depende del tipo de dato que sea tu parametro..
Open;
Edit2.Text:=IntoStr(Query1['totalReg']);
end;
__________________
Ing. LUIS FERNANDO ORJUELA
BOGOTA - COLOMBIA
|