Eliminate duplicates in query

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

Access 2000. I have a main table and a details table. The main table has:
EmployeeID, CurrentDate, Expenses. The details table has: CustomerID,
Fees, Miles, Hours. I have a query with both tables joined. An employee
may have 1 to 6 records in the details table per day. The problem is when i
run the query I get "Expenses" listed multiple times coresponding to the
number of records in the details table. I need a report that shows me the
expenses for one day ($48.00) not $288.00 if I have 6 records. Thanks,
Randy
 
Randy said:
Access 2000. I have a main table and a details table. The main table has:
EmployeeID, CurrentDate, Expenses. The details table has: CustomerID,
Fees, Miles, Hours. I have a query with both tables joined. An employee
may have 1 to 6 records in the details table per day. The problem is when i
run the query I get "Expenses" listed multiple times coresponding to the
number of records in the details table. I need a report that shows me the
expenses for one day ($48.00) not $288.00 if I have 6 records. Thanks,
Randy

SELECT SUM(Expenses) AS TotalExpenses
FROM MyTable
GROUP BY EmployeeID, ExpenseDate

or something along those lines. Check out totals queries in the help.
(Hidden carefully under the F1 key).
 
Back
Top