cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Time Fields

Former Member
0 Kudos

I have a Date-Time field that I need to add to a calculated time formula.

Ex.

{Table.Date-Time} contains data like 09/21/2016 11:11:59 AM

{@Hours} contains data like 1.51 hours

I have tried the following:

TIME({Table.Date-Time} + ({@Hours}/3600)

or TIME({Table.Date-Time} + ({@Hours})

Either one of these are giving me an "Numeric Overflow".

In the above example, my expected output is 12:42:05 PM. I do not need the date, just the time.

I am not sure what to do or how to change the formula.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

Try something like this:

TIME(DateAdd('h', {@Hours}, {Table.Date-Time}))

-Dell

Former Member
0 Kudos

It is almost there. I get 12:11:59 PM instead of 12:42:05 PM. It is missing the minutes and seconds.

DellSC
Active Contributor
0 Kudos

It may not like the decimal part of the hours. Try this instead:

TIME(DateAdd('n', Round(({@Hours}  * 60), 0), {Table.Date-Time}))

This will change the hours to minutes and round to the nearest whole minute.

Or, you could use seconds:

Time(DateAdd('s', ({@Hours} * 3600), {Table.Date-Time}))

-Dell

Former Member
0 Kudos

Works great. Thank you. Date-Time issues always get me.

Answers (0)