Add Start & End Time together to calculate total time

dcollard23

Registered User.
Local time
Today, 05:22
Joined
Jun 15, 2009
Messages
87
Hello,
My employees are entering how long it will take them to do a transaction. They will click a checkbox to give them the start time in a sepate text box. They will click a checkbox to give them the end time in a sepate text box. Both have the input mask of 00:00. I would like to add the start time and end time together to get the total time in a separate text box. If one of the fields are blank I would like to give a time of 0. I would like to add hours and minutes together.
I think I almost have it. I am using this module and formula:
Module:
Public Function HrsMin(ByVal startDate As Date, ByVal endDate As Date) As String
Dim diff As Double
diff = (endDate - startDate) * 24
HrsMin = Int(diff) & ":" & (diff - Int(diff)) * 60
End Function

Formula:
=IIf(IsNull([start time]) Or IsNull([end time]),"0",(hrsmin([start time],[end time])))

Result:
Start Time: 12:09
End Time: 12:16
Total: 0:06.750000000
I want like the reulst to show 0:07 minutes.

How would I go about doing this.
You help is always appreciated.
Elaine
 
Thank you for your reply.

Elaine
 

Users who are viewing this thread

Back
Top Bottom