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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
calculating total minutes for each employee
I have 3 columns of data.
First column has Employee # 2nd column has Code_Name 3rd column has number of minutes The information repeats for each employee over several rows. Example: Employee# Code_Name Minutes 240123 lunch 30 250567 lunch 30 240123 break 15 240567 break 15 240123 lunch 30 250567 lunch 30 I like to find out the total number of minutes each employee spent in lunch and breaks. Thank you. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...esign/200908/1 |
#2
|
|||
|
|||
calculating total minutes for each employee
On Thu, 06 Aug 2009 04:24:50 GMT, "access_learner via AccessMonster.com"
u53425@uwe wrote: I have 3 columns of data. First column has Employee # 2nd column has Code_Name 3rd column has number of minutes The information repeats for each employee over several rows. Example: Employee# Code_Name Minutes 240123 lunch 30 250567 lunch 30 240123 break 15 240567 break 15 240123 lunch 30 250567 lunch 30 I like to find out the total number of minutes each employee spent in lunch and breaks. Thank you. Create a Query based on the table; select all three fields. Make it a Totals query by clicking the Greek Sigma icon (looks like a sideways M). Leave the default Group By on the totals row under Employee# and Code_name and change it to Sum under [Minutes]. Open the query datasheet - it'll sum with the grouping you specify. If you want the grand total of lunch and break, either leave Code_name out of the query altogether, or - if you want to see the sum of break, sum of lunch, and grand sum of both - create a Report and use its Sorting and Grouping feature to do the totalling. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
calculating total minutes for each employee
access_learner,
Try the below... The below is based on the fact that minutes is a numeric field??? (Guessing because of the way you are representing the data.) SELECT YourTableName.[Employee#], YourTableName.Code_Name, Sum(YourTableName.Minutes) AS SumOfMinutes FROM YourTableName GROUP BY YourTableName.[Employee#], YourTableName.Code_Name HAVING (((YourTableName.Code_Name)="Lunch")); -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "access_learner via AccessMonster.com" u53425@uwe wrote in message news:9a2c80c2d92e8@uwe... I have 3 columns of data. First column has Employee # 2nd column has Code_Name 3rd column has number of minutes The information repeats for each employee over several rows. Example: Employee# Code_Name Minutes 240123 lunch 30 250567 lunch 30 240123 break 15 240567 break 15 240123 lunch 30 250567 lunch 30 I like to find out the total number of minutes each employee spent in lunch and breaks. Thank you. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...esign/200908/1 |
Thread Tools | |
Display Modes | |
|
|