Hola Douglas, es tan sencillo como esto:
Código Delphi
[-]procedure TForm5.Button1Click(Sender: TObject);
var
b,fecha1,fecha2:string;
a,gan:real;
begin
adoquery1.Close;
adoquery1.SQL.Text:='select sum(ganancia) from '+quotedstr('ciber') where fecha between :Fechain and :Fechafin';
ADOquery1.Parameters.ParamByName('Fechain').Value:=fecha1;
ADOquery1.Parameters.ParamByName('Fechafin').Value:=fecha2;
adoquery1.Open;
edit1.Text:=FloattoStr(ADOQuery1.Fields[0].asFloat);
end;
espero que te ayude.
Saludos.