Results 1 to 9 of 9
  1. #1
    cdh is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    15

    Calculating total hours that cross midnight.

    I am trying to create an expression that calculates the total hours worked that may or may not cross midnight. I am using 2007 with colums titled Start Date, End Date, Start Time, End Time, and Total Hours. I need this to work in both forms and reports. Can anyone please help?
    Last edited by cdh; 05-21-2010 at 02:38 PM. Reason: solved

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

  3. #3
    cdh is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    15

    that worked great thank you

    Works great

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help.

  5. #5
    cdh is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    15
    Ok so that solved the issue of calculating the total time, now when i try to get the total time (calculated field) to multiply by the hourly rate (input value) it gives me an error. I know this should be easy to figure out, but it has agrivated me. How can i perform a calculation on a calculated field?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do the calculation in the AfterUpdate event of the control where you input the Hourly Rate.

  7. #7
    cdh is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    15

    Attached DB for your Review

    Ok, so I think I did what you asked correctly, however it didn't change anything. I have attached the database for you to review and see what can be done to make it work. I am working on the Required Positions Form. Thanks for all your help.

    Attachment removed at the request of the poster - RG

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Note the follow up question has been asked elsewhere:

    https://www.accessforums.net/access/...orts-5829.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks Paul. cdh: we will let the other thread come up with the solution. I am going to lock this thread for now.

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

Similar Threads

  1. Replies: 7
    Last Post: 04-27-2010, 02:47 PM
  2. Cross Tab Query
    By RycherX in forum Queries
    Replies: 1
    Last Post: 04-26-2010, 12:19 PM
  3. How to calculate duration in hours & minutes
    By joypanattil in forum Access
    Replies: 0
    Last Post: 11-25-2009, 04:49 AM
  4. hours + condition
    By Miriam in forum Queries
    Replies: 0
    Last Post: 08-09-2009, 06:46 AM
  5. Need help with calculating Time total
    By Monoceros in forum Reports
    Replies: 1
    Last Post: 04-20-2009, 12:44 PM

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