Ver Mensaje Individual
  #3  
Antiguo 01-03-2004
__cadetill __cadetill is offline
Miembro
 
Registrado: may 2003
Posts: 3.387
Reputación: 25
__cadetill Va por buen camino
ha de ser acomulado por fechas o por cliente o por ambos??

si es por fechas:
Código:
select fecha, sum(importe)imp,sum(iva)iv,sum(total)tot
from ventas
where fecha between :fechaini and :fechafin
group by fecha
order by fecha
Donde fechaini y fechafin son parametros que hay que informar

Si es por cliente y fecha
Código:
select cliente, fecha, sum(importe)imp,sum(iva)iv,sum(total)tot
from ventas
where fecha between :fechaini and :fechafin
group by cliente, fecha
order by cliente, fecha
Si es por fecha y cliente
Código:
select fecha, cliente, sum(importe)imp,sum(iva)iv,sum(total)tot
from ventas
where fecha between :fechaini and :fechafin
group by fecha, cliente
order by fecha, cliente
Espero te sirva
Responder Con Cita