sum of two or multiple hh:mm:ss

vman21

Registered User.
Local time
Yesterday, 19:43
Joined
Feb 25, 2014
Messages
18
I have two textboxes where each contains hh:mm:ss values and I have to get the sum of these two. Currenlty, I was able to split them up and converted hours to minutes and seconds to minutes. However, I am facing a challenge converting minutes back to hh:mm:ss. Is there an easier way to do this?

converting from hours to minutes and sum up the minutes
Code:
Split(2:05:05, ":")(0) * 60 + Split(2:05:05, ":")(1)
 
Assuming you dont cross the 24 hour "limit" on a day, simply add them together:
Field1 + Field2

Or potentially if they are text fields:
Timevalue(Field1) + TimeValue(field2)
 
Assuming you dont cross the 24 hour "limit" on a day, simply add them together:
Field1 + Field2

Or potentially if they are text fields:
Timevalue(Field1) + TimeValue(field2)

Thanks. I did it the other way since in my case it is possible that the sum of all time may cross the 24 hour limit.
 

Users who are viewing this thread

Back
Top Bottom