I need to create a formula field that adds time in both hours and minutes to an existing database field. I have a start date/time and need to add the duration to create an end date/time.
My start date field is metric_hist.datetime_dttm.
I have a @Duration field ({metric_hist.numeric_qty}/60)/60. It’s stored in seconds and I needed to convert it hours and minutes.
For my end date formula field I attempted to use this:
DateAdd ("h", {@Duration}, {metric_hist.datetime_dttm})
It works correctly when the duration is greater than 1 hour. However, I’m having a problem when the duration is < than an hour. I have many instances where the duration is 0.12, 0.25, 0.55, etc. When this is the case it does not add to the time. It works as expected when the duration is > 1 hour.
If someone could help I’d greatly appreciate it.
My start date field is metric_hist.datetime_dttm.
I have a @Duration field ({metric_hist.numeric_qty}/60)/60. It’s stored in seconds and I needed to convert it hours and minutes.
For my end date formula field I attempted to use this:
DateAdd ("h", {@Duration}, {metric_hist.datetime_dttm})
It works correctly when the duration is greater than 1 hour. However, I’m having a problem when the duration is < than an hour. I have many instances where the duration is 0.12, 0.25, 0.55, etc. When this is the case it does not add to the time. It works as expected when the duration is > 1 hour.
If someone could help I’d greatly appreciate it.