Results 1 to 2 of 2
  1. #1
    sathishj1981 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Mar 2013
    Posts
    1

    Question Elapsed Time by Area

    New here,

    I have a two tables

    table A (Clockin)
    Date EmpId StartTime Area
    3/12/13 AA243 1100 001
    3/12/13 AA253 1103 002
    3/12/13 AA263 1108 003
    3/12/13 AA273 1150 004

    table B (Area Change and Clock out)
    Date EmpId In Area
    3/12/13 AA243 1530 003
    3/12/13 AA253 1745 003
    3/12/13 AA263 1617 002
    3/12/13 AA273 1545 002
    3/12/13 AA243 1630 003
    3/12/13 AA253 1645 003
    3/12/13 AA263 1617 002
    3/12/13 AA273 1645 002

    I can calculate total hours by employee (start time - clockout time (Max of Table b))
    I need help calculating hours by Area, results like

    Area Hours
    001 4.30
    002 12.6
    003 9.7
    004 3.95

    Thanks for any help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,636
    Doesn't look easy.

    What do you mean by 'Area Change'? Employee is moving between areas so the In time of one record is the out time of earlier In?

    Not only have to combine two datasets with UNION query will then need subquery to calculate data between sequential records. Will really get complicated if the change occurs accross midnight. Date and time need to be one value for that.

    Review http://allenbrowne.com/subquery-01.html especially the example for Get Value In Another Record. However, in your case can't rely on a single unique ID field. Requires the combination of Date, Time, EmpID to serve as a unique identifier and all three need to be sort criteria.

    After all that, then do a Totals (aggregate) query grouping on the Area.

    Your sample data in Table2 has two identical records for EmpID AA263.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Total elapsed time
    By Craigind in forum Access
    Replies: 1
    Last Post: 05-14-2012, 03:54 AM
  2. HELP With Elapsed Time in Form
    By accessineedhelp in forum Forms
    Replies: 6
    Last Post: 09-01-2011, 10:30 AM
  3. HELP! Elapsed Time Difference
    By accessineedhelp in forum Access
    Replies: 5
    Last Post: 08-31-2011, 06:00 PM
  4. Calculating Elapsed Time
    By jo15765 in forum Forms
    Replies: 8
    Last Post: 04-15-2011, 07:00 PM
  5. Time Elapsed Problem
    By leejqs in forum Reports
    Replies: 6
    Last Post: 07-16-2009, 07:58 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums