Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 01-03-2004
__cadetill __cadetill is offline
Miembro
 
Registrado: may 2003
Posts: 3.387
Poder: 27
__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
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 22:45:13.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi