calculating total minutes for each employee

  • Thread starter access_learner via AccessMonster.com
  • Start date
A

access_learner via AccessMonster.com

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

John W. Vinson

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

Gina Whipp

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
 

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