Ver Mensaje Individual
  #4  
Antiguo 25-07-2024
marco3k marco3k is offline
Miembro
 
Registrado: feb 2015
Posts: 94
Reputación: 11
marco3k Va por buen camino
Código Delphi [-]
var
    anios:string;

begin
  anios:=(1925,1955,1920);

  IBQueryMotivos.SQL.Clear;
  IBQueryMotivos.SQL.Add('select * from motivos where año in '+ANIOS);
  IBQueryMotivos.Open;

Eso de arriba debe ser así y me comentas como te fue:
Código Delphi [-]
var
    anios:string;

begin
  anios:='1925,1955,1920';

  IBQueryMotivos.SQL.Clear;
  IBQueryMotivos.SQL.Add('select * from motivos where año in ('+anios+')');
  IBQueryMotivos.Open;

Lo demás es hacer un bucle para coger los años, Roman ya te dio un ejemplo.

Última edición por marco3k fecha: 25-07-2024 a las 20:53:22.
Responder Con Cita