Código Delphi [-] with DMo.query2 do begin Close; SQL.Clear; SQL.Add('select count(1) as contador from agua where id_protocolo= '+(IntToStr(DMo.T_protocolosid_analisis.Value))); Open; UnaVariable := FieldByName('Contador').AsInteger; //UnaVariable := Fields[1].Value; end;
with DMo.query2 do begin Close; SQL.Clear; SQL.Add('select count(1) as contador from agua where id_protocolo= '+(IntToStr(DMo.T_protocolosid_analisis.Value))); Open; UnaVariable := FieldByName('Contador').AsInteger; //UnaVariable := Fields[1].Value; end;