Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Oct 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculate time (2002)

    I have three text boxes, labeled time in, time at lunch, and time out. Time in and out are short time format. Time at lunch is fixed(?) to accomodate .5, .75, 1, etc.
    I would like to have a total hours worked box that calculates the net time worked (time out-time in - lunch) but the formatting of the time at lunch messes up the result...Is there a way to do this?? Thanks! Scott

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Calculate time (2002)

    The total time can easily be derived by this formula:

    TotalTime= TimeOut - TimeIn - TimeAtLunch/24

    Access keeps the Time portion of Date/Time fields as a decimal portion of 1 day (that is, 24 hours). So, TimeOut-TimeIn gives total elapsed time. Subtract from that the TimeAtLunch (converted to decimal days).
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Star Lounger
    Join Date
    Oct 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculate time (2002)

    Thanks, your suggestions worked perfectly. I have a TotalHours text box and would like to know if there's a way to extract (for overtime hours) hours worked between 35 - 40 hours, and an additional box for hours over 40. (They way I would do it in Excel doesn't work)
    Thanks again for the help!

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Calculate time (2002)

    You wrote:
    >>Thanks, your suggestions worked perfectly. I have a TotalHours text box and would like to know if there's a way to extract (for overtime hours) hours worked between 35 - 40 hours, and an additional box for hours over 40. (They way I would do it in Excel doesn't work)<<

    I'm sorry, but I don't understand the situation. You are already entering times for each day, but you have another textbox for total hours?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    352
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calculate time (2002)

    I would tend to do these calcualtions in the underlying querie. It is easy to add columns to the query with calculations based on another column. Then to put text boxes on the form or report bound to those columns.

    The formulae will be similar to the excel formulae.
    David Grugeon
    Brisbane Australia

  6. #6
    Star Lounger
    Join Date
    Oct 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculate time (2002)

    The TotalHours text box is for the sum of the week's hours (mon - fri), hours between 35 and 40 are at one pay rate, above 40 at another. If possible, I would like to create one box that can count (from the weekly total hours) any hours worked between 35 and 40, and another box that can count (from weekly total hours) all hours above 40. Sorry for the confustion and thanks again for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •