Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/09/2011, 04:24
Pelirr
 
Fecha de Ingreso: diciembre-2008
Mensajes: 233
Antigüedad: 15 años, 4 meses
Puntos: 1
consultas query en jasperreport, listado strings

Hola, estoy intentando hacer una consulta con JasperReport y no comprendo porqué no funciona. La query es la siguiente:

Cita:
select
companies.company as compania,
(select
count(*)
from `aodb`.`arrivalflight` a
where a.iataCompanyCode = compania and a.scheduledTime >= $P{fechaInformeDesde} and a.scheduledTime < $P{fechaInformeHasta}
) as numArr,
(select
count(*)
from `aodb`.`departureflight` b
where b.iataCompanyCode = compania and b.scheduledTime >= $P{fechaInformeDesde} and b.scheduledTime < $P{fechaInformeHasta}
) as numDep,
(
(select
count(*)
from `aodb`.`arrivalflight` a
where a.iataCompanyCode = compania and a.scheduledTime >= $P{fechaInformeDesde} and a.scheduledTime < $P{fechaInformeHasta}
)
+
(select
count(*)
from `aodb`.`departureflight` b
where b.iataCompanyCode = compania and b.scheduledTime >= $P{fechaInformeDesde} and b.scheduledTime < $P{fechaInformeHasta}
)
) as totalMov

from
(select distinct
e.iataCompanyCode as company
from `aodb`.`arrivalFlight` e where e.iataCompanyCode in ($P{listadoAerolineas})
union
(select distinct
f.iataCompanyCode as company
from `aodb`.`departureflight` f where f.iataCompanyCode in ($P{listadoAerolineas})
)
) as companies;
dónde listadoAerolineas es un parámetro, un string, al que si le meto los valores de modo por ej. IB", "SPP", "AEM es decir, como una lista de strings pero sin las comillas inicial y final, en otros casos, otros reportes me funciona perfectamente, pero con esta consulta no, y no tengo ni idea de porqué. Y si le meto por ejemplo solamente el valor IB, sólo un valor, entonces me funciona bien, pero necesito meterle varios.

¿Puede alguien echarme un cable? No comprendo porqué en unos sitios sí y en otros no, me estoy haciendo un lío.
Muchas gracias