Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/05/2014, 16:23
Avatar de Maverick2786
Maverick2786
 
Fecha de Ingreso: diciembre-2012
Mensajes: 107
Antigüedad: 11 años, 5 meses
Puntos: 1
Problema con consulta fecha

Código MySQL:
Ver original
  1. select concat(f1.nro_identificacion,f1.tipo_identificacion)  as cant
  2.     from formulario_f1 as f1 inner join formulario_f5 as f5
  3.     on concat(f1.nro_identificacion,f1.tipo_identificacion) = concat(f5.nro_identificacion,f5.tipo_identificacion)
  4.     inner join formulario_f4_f7 as f4f7
  5.     on concat(f1.nro_identificacion,f1.tipo_identificacion) = concat(f4f7.nro_identificacion,f4f7.tipo_identificacion)
  6.     where f1.fecha_atencion between (year(f1.fecha_atencion) = '2011' and  month(f1.fecha_atencion)='7')  
  7.     and (year(f4f7.fecha_atencion) = '2012' and month(f4f7.fecha_atencion)='5')
  8.     and f1.status='A'
  9.     and f5.en_tarv = 1
  10.     and f4f7.tipo_esquema_indicado=1
  11.     and concat(f4f7.nro_identificacion,f4f7.tipo_identificacion) not in
  12.             (select concat(f4f7.nro_identificacion,f4f7.tipo_identificacion)  as cant
  13.             from formulario_f4_f7 as f4f7
  14.             where f4f7.tipo_esquema_indicado in (2,3)
  15.             group by concat(f4f7.nro_identificacion,f4f7.tipo_identificacion)
  16.             )
  17.     group by concat(f1.nro_identificacion,f1.nro_identificacion)

Yo se que me tiene que devolver un nombre, pero me da vacio
Gracias por su tiempo

Última edición por Maverick2786; 02/05/2014 a las 16:45