1. ## 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. ## 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).

3. ## 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. ## 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?

5. ## 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.

6. ## 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
•