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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

calculating total minutes for each employee



 
 
Thread Tools Display Modes
  #1  
Old August 6th, 2009, 05:24 AM posted to microsoft.public.access.tablesdbdesign
access_learner via AccessMonster.com
external usenet poster
 
Posts: 5
Default 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  
Old August 6th, 2009, 07:07 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old August 6th, 2009, 04:23 PM posted to microsoft.public.access.tablesdbdesign
Gina Whipp
external usenet poster
 
Posts: 3,500
Default 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

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 03:39 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.