Query Quandries

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

i have a table, tblgeneral, that contains order
information on customers, referenced by tblcustomer, what
i am attempting to do is show how many unique customers -
and the total repair cost for a date range per salesman.
for example; salesman 1 had a total repair cost of 1500.00
for the month of january 04 from 5 different customers.
what i am currently getting is; salesman 1 had a total of
1500.00 from 20 customers (it is counting the total number
of customers - not the unique number)
Please help - i am getting so confused.
Frank
 
SELECT TBLSALESREP.Region, TBLSALESREP.SalesRep, Count
(CLIENTES.CODIGO) AS CountOfCODIGO, Sum([TBL GENERAL].
[REPAIR PRICE]) AS [SumOfREPAIR PRICE]
FROM TBLSALESREP INNER JOIN (CLIENTES INNER JOIN [TBL
GENERAL] ON CLIENTES.CODIGO = [TBL GENERAL].[CUST ID]) ON
TBLSALESREP.SalesRep = CLIENTES.VENDEDOR
WHERE ((([TBL GENERAL].[RPRD DATE]) Between [Starting
Date] And [Ending Date]))
GROUP BY TBLSALESREP.Region, TBLSALESREP.SalesRep;
 
Back
Top