Ver Mensaje Individual
  #8  
Antiguo 03-08-2006
IVAND IVAND is offline
Miembro
 
Registrado: may 2003
Ubicación: ECUADOR
Posts: 524
Reputación: 22
IVAND Va por buen camino
Nuevamente gracias a todos por las respuestas el query quedo algo asi ,

Código SQL [-]
Select v1.nombre nomb_ven,count(distinct(key_producto_b)) as Nveces, sum(d.cantidad) TcantVend,
sum(total_linea) tventa,Round(sum(d.cantidad*d.precio_prom),2) Tcosto,
Round(sum(d.total_linea-d.precio_prom*d.cantidad),2) Util
from vendedor v1,cab_fac c,det_fac d
Where c.estado_fac='T'
and extractDate(c.fec_factura) between :desde and :hasta
and c.key_vendedor=v1.key_vendedor
And c.key_cab_fac=d.key_cab_fac

Group by v1.nombre
Order by 1
__________________
IVAND

Última edición por vtdeleon fecha: 03-08-2006 a las 23:44:17.
Responder Con Cita