Ver Mensaje Individual
  #5  
Antiguo 07-06-2013
aposi aposi is offline
Miembro
 
Registrado: dic 2006
Posts: 146
Reputación: 18
aposi Va por buen camino
Código SQL [-]

Select distinct a.forma_envio, COALESCE((select sum(s.CANT_EJEMPLARES)
From SUSCRIPCIONES s 
Where (s.TIPO_SCIONES = 'PAPEL' or s.TIPO_SCIONES = 'PAPEL E INTERNET') and s.ESTADO_SCIONES = 'A' and '2013/06/08' BETWEEN s.f_inic_sciones AND s.f_fin_sciones and s.cod_sucursal = 1
and s.forma_envio = a.forma_envio), 0) AS cant_reserva
from SUSCRIPCIONES a 
order by a.forma_envio

Puedes provar este sql a ver como va

Última edición por aposi fecha: 07-06-2013 a las 19:56:11.
Responder Con Cita