Tema: Php/mssql
Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/10/2008, 10:04
Avatar de masterojitos
masterojitos
 
Fecha de Ingreso: julio-2008
Ubicación: Lima Callao Chucuito
Mensajes: 1.931
Antigüedad: 15 años, 9 meses
Puntos: 105
Respuesta: Php/mssql

y prueba asi:

select *
from clientes a
where exists ( select sum(importe)
from faclin b
inner join faclinprod c on b.faclincod = c.faclincod where c.fecha between '01/01/2007' and '31/12/2008' and b.cliente = a.cliente and b.grupcli = a.grupcli
having sum(importe)>0 )
and a.grupcli = 'AGEN'
__________________
Atte. MasterOjitos :ojotes:
Todo sobre Programación Web
Las ultimas tendencias en Efectos y Recursos Web: MasterOjitos Blog