Results 1 to 2 of 2
  1. #1
    Reaper is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Posts
    57

    Calculating manhours

    I have three fields named:



    StartTime (Short Time)
    EndTime (Short Time)
    LaborCount (Long Integer)

    LaborCount is the number of persons assigned to an activity.

    I want to calculate the total man-hours for the activity.

    My current expression is: (EndTime-StartTime)*LaborCount

    The start and end times correctly calculate, but the final calculation
    comes out wrong. For example, (8:00) times 12 (laborcount) comes out as
    15:00.

    I wanted it to be 96:00, but kind of expected it to come out to 0:00 as this is an exact multiple of the 24 hour day. The 15:00 really thru me off.

    Suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929

    Time / Decimal Conversion

    I just learned a new intrinsic function.

    TimeValue("8:22")*24*12 will return 100.4, the total hours in decimal hours.

    So your expression would be like TimeValue(EndTime-StartTime)*24*LaborCount).

    If you want to convert back to hours:minutes, something like:

    Int(DecTime) & ":" & Int((DecTime-Int(DecTime)) * 60)

    Or

    Int(DecTime) & ":" & Round((DecTime-Int(DecTime)) * 60,0)

    Be aware Round use even/odd rule.
    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. Calculating all possible combinations
    By Data in forum Queries
    Replies: 3
    Last Post: 06-20-2011, 03:02 PM
  2. Calculating Max appointments
    By ET123 in forum Access
    Replies: 2
    Last Post: 07-24-2010, 07:32 AM
  3. Calculating Networkdays
    By jsiketa in forum Queries
    Replies: 1
    Last Post: 06-10-2010, 06:05 PM
  4. Calculating Dates
    By TC0126 in forum Queries
    Replies: 1
    Last Post: 02-23-2010, 08:13 PM
  5. Calculating Values
    By Jahan in forum Queries
    Replies: 1
    Last Post: 07-09-2006, 09:15 AM

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