Calculating Times

TheShed

New member
Local time
Today, 10:23
Joined
May 6, 2008
Messages
9
I am trying to calculate the difference between the start time of a job and the finish time. I am using the following:-

Dim worked As Date
worked = DateDiff("h", [startTime], [finishTime]) / 24


Which is fine when the time worked is a full hour. Some jobs can be 30 minutes though and using the above code it will only calculate full hours. i.e. - start time is 14:00 and finish time is 14:30, it will show calculate "worked" as 01:00 hour.

Any tips on how to solve this? Thanks :)
 
Just do Worked = [Finishtime]-[Starttime]

That should return the exact number of minutes, seconds, hours days, however long the job took.
 
Just do Worked = [Finishtime]-[Starttime]

That should return the exact number of minutes, seconds, hours days, however long the job took.

Excellent. So simple! thanks so much :)
 

Users who are viewing this thread

Back
Top Bottom