How Do you get totals for distinct records on a form

A

aadele03

Hello my name is AJ Johnson, i am making a form, that allows students
to recieve discounts based on Hrs they've worked. the table looks like
this ID Employee_UIN Pay period Hrs_Worked

1 67613523 8/26/2006 12

2 65632153 8/26/2006 13

3 36212362 8/26/2006 5

4 67613523 9/7/2006 10

5 65632153 9/7/2006 4

6 36212362 9/7/2006 8
How do i make a form that shows a total of Hrs worked for each
Employee_UIN, i have been battling with this for days, any help will be
greatly appreciated
thanks AJ
 
K

Klatuu

Create a totals query that Groups By Employee_UIN and Sums on Hrs_Worked

If this info needs to be included with other Employee data on the field, Use
a query based on the employee table rather than the table itself and join the
totals query to the employee table query on the Employee_UIN and add the
field with the Sum of the hours worked as a field in the Employee table
query. Then put a control on your form to display it and make the sum field
the control source for the query.
 
D

Douglas J. Steele

SELECT Employee_UIN, Sum(Hrs_Worked) AS Total_Worked
FROM MyTable
GROUP BY Employee_UIN
 

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