Total de Vendas Por Cliente

Delphi

24/05/2004

Pessoal

Preciso de uma query onde me mostre o total de vendas por clientes em um determinado período:

Exemplo

Cliente 1 - 10,00 - 24/05/2004
Cliente 2 - 15,00 - 27/04/2004
Cliente 7 - 30,00 - 15/03/2004
Cliente 1 - 5,00 - 14/05/2004
Cliente 1 - 30,00 - 01/04/2004

Seleciono o Cliente 1 no período 01/05 a 30/05

O relatório me mostraria o total do cliente 1 (15,00) no período

estou no aguardo


Emerson.silva

Emerson.silva

Curtidas 0

Respostas

Fer_nanda

Fer_nanda

24/05/2004

Select 
  * 
from 
  Vendas
where 
  data between :data1 and :data2 and
  codigo_cliente = :cliente



GOSTEI 0
Rômulo Barros

Rômulo Barros

24/05/2004

Select 
  * 
from 
  Vendas
where 
  data between :data1 and :data2 and
  codigo_cliente = :cliente


???????????????????
:?: :?: :?: :?: :?:


GOSTEI 0
Fer_nanda

Fer_nanda

24/05/2004

me enganei,

[code]
Select
cliente,
sum(valor) as valortotal
from
Vendas
where
data between :data1 and :data2 and
codigo_cliente = :cliente



GOSTEI 0
Rômulo Barros

Rômulo Barros

24/05/2004

me enganei,
Select 
  cliente,
  sum(valor) as valortotal
from 
  Vendas
where 
  data between :data1 and :data2 and
  codigo_cliente = :cliente
:?: :?: :?: :?: :?: :?: :?: [code] Select C.NomeCliente,V.DtVenda, sum(V.Valor) as ValorTotal from Clientes C, Vendas V where C.CodCliente = V.CodCliente And D.data between :data1 and :data2 and C.CoCliente = :cliente Group By C.NomeCliente,V.DtVenda


:twisted: :twisted: :twisted: :twisted: :twisted:


GOSTEI 0
POSTAR