Adding 2 time fields together

analyst1

Registered User.
Local time
Today, 00:50
Joined
Nov 9, 2009
Messages
24
Hi,

I have 2 time fields and I want to add them together. First, i think that i would convert them into minutes then just add the minutes together.

For example,
time 1 = 07:30
time 2 = 02:15
answer should be = 9:45 or 9 hours, 45 minutes

how would i go about doing this?
 
Hi,

I have 2 time fields and I want to add them together. First, i think that i would convert them into minutes then just add the minutes together.

For example,
time 1 = 07:30
time 2 = 02:15
answer should be = 9:45 or 9 hours, 45 minutes

how would i go about doing this?

Provided the field only contains a time and not a date as well, you can multiply the field by 1440 (number of minutes in a day) to get the total minutes. If there are seconds as well in the field, you will end up with a decimal number for the seconds. This will give you the total minutes.
 
=[time 1] + [time 2] works.
To get into date & hours format:

=(cdbl([time 1]) + cdbl([time 2]))*24

To get into decimal format e.g 9.75 hrs.

1 in a date/time field represents 24 hours.

If you expect to have totals beyond 24 hours, I suggest avoiding time formats altogether as either:
Output below 24 hours will be in time format, output above will be in decimal format resulting in confusion.
Or
Output above 24 hours will (e.g. 25:00) show incorrectly (as 01:00).

Alternatively, you could write a vba function that wll show correct output as a string.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom