Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Thu, 4 Sep 2008 07:24:33 -0700,    group: microsoft.public.access.queries        back       


New user question - timesheet query   
I have been inputting employee timesheet data into a table for the last 3 
months.
I have been able to write a query to give the total hours worked in this 
time, but I am struggling to develop a query to give me the average hours 
worked for each employee over the last rolling 12 weeks.
Please help but keep it simple - thanks.
date: Thu, 4 Sep 2008 07:24:33 -0700   author:   mikey

RE: New user question - timesheet query   
If your data is stored like this --
EMP   WorkDate  WorkHours
1        2/2/2008    4.5
2        2/2/2008     9
1        2/3/2008     7
2        2/3/2008     6.5

Then use this query and name EMP_Week_Hrs --
SELECT EMP Format([WorkDate], "yyyyww") AS Worked, Sum([WorkHours]) AS Hours
FROM YourTable
WHERE WorkDate Between Date() And DateAdd("ww", -12, Date())
GROUP BY EMP, Format([WorkDate], "yyyyww");

SELECT EMP, [Hours]/12 AS Avg_per_week
FROM EMP_Week_Hrs;
 
-- 
KARL DEWEY
Build a little - Test a little


"mikey" wrote:

> I have been inputting employee timesheet data into a table for the last 3 
> months.
> I have been able to write a query to give the total hours worked in this 
> time, but I am struggling to develop a query to give me the average hours 
> worked for each employee over the last rolling 12 weeks.
> Please help but keep it simple - thanks.
date: Thu, 4 Sep 2008 08:22:01 -0700   author:   KARL DEWEY

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us