# Thread: calculating total time on a timesheet.

1. ## calculating total time on a timesheet.

I need to calculate total time worked in a period with multiple work days. For each workday I have a start time and a finish time. I have no problem if the time worked is an exact # of hours. But if there should be a fraction of an hour in the total, it is truncated.

I'm using the following calcs to arrive at the daily time worked:

If StartTime > FinishTime Then
myFinish = FinishTime + 1
Else
myFinish = FinishTime
End If
MyHours = DateDiff("h", StartTime, myFinish)

StartTime and FinishTime are provided from input data. Again this function works fine if the time is an even hour. Otherwise, no go.

2. ```MyTime = DateDiff("n", StartTime, myFinish) 'In minutes
'Return Hours and minutes
MyHours = MyTime\60 'Note \ vs /
MyMins = MyTime Mod 60

'Return decimal hours
MyHours = MyTime/60 'Note / vs \```

3. Originally Posted by SamT
```MyTime = DateDiff("n", StartTime, myFinish) 'In minutes
'Return Hours and minutes
MyHours = MyTime\60 'Note \ vs /
MyMins = MyTime Mod 60

'Return decimal hours
MyHours = MyTime/60 'Note / vs \```
The wizard of Access strikes again. Worked right the first time. Thanks.

4. Usage of swing shifts might help you. A lot of businesses use swing shifts to rotate their roster. Employers use swing shifts to keep up with work when it's too busy. This might be good for the employees too because it might give them more time for their personal things. The disadvantage of swing shifts might be creating the schedule. It is too much you have to plan, and it's hard because people are coming and going all the time. It has its good and bad sides. I worked a swing shift while I was studying. It was perfect for me because I had to attend classes too.

5. Originally Posted by LiamLambert
Usage of swing shifts might help you. A lot of businesses use swing shifts to rotate their roster. Employers use swing shifts to keep up with work when it's too busy. This might be good for the employees too because it might give them more time for their personal things. The disadvantage of swing shifts might be creating the schedule. It is too much you have to plan, and it's hard because people are coming and going all the time. It has its good and bad sides. I worked a swing shift while I was studying. It was perfect for me because I had to attend classes too.
Too late, the company is going out of business. Founded in the 1824.

#### Posting Permissions

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