A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Eliminate duplicates in query



 
 
Thread Tools Display Modes
  #1  
Old October 4th, 2006, 09:22 PM posted to microsoft.public.access.queries
Randy
external usenet poster
 
Posts: 4
Default Eliminate duplicates in query

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


  #2  
Old October 5th, 2006, 08:29 AM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 264
Default Eliminate duplicates in query


Randy wrote:
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).

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.