Eliminate duplicates in query

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
 
P

pietlinden

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top