Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: How Do you get totals for distinct records on a form

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

How Do you get totals for distinct records on a form
aadele03[ at ]aol.com 29.09.2006 14:37:38
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

RE: How Do you get totals for distinct records on a form
Klatuu 29.09.2006 14:55:02
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.

"aadele03[ at ]aol.com" wrote:

[Quoted Text]
> 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
>
>
Re: How Do you get totals for distinct records on a form
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 29.09.2006 14:55:24
SELECT Employee_UIN, Sum(Hrs_Worked) AS Total_Worked
FROM MyTable
GROUP BY Employee_UIN

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


<aadele03[ at ]aol.com> wrote in message
news:1159540657.884806.108920[ at ]i42g2000cwa.googlegroups.com...
[Quoted Text]
> 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
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net