Add Partial Days to DateTime

TJD
New Member

Hi,

I need to calculate the end date and time from 2 input values, like so:
End Date = [Start Date] + [Days]
Where Start Date is DateTime type, and Days is a Number type. That works just fine, so if experiment starts on 5/5/2019 03:00 AM and is expected to go for 1 days, then the End Date will be calculated properly as 5/6/2019 03:00 AM.

However, occasionally the experiment is scheduled to run for half a day (formatted as 0.5 in the source table). The Number type wonโ€™t let me enter decimals, so I switch it to type Decimal. My hope was that the result would be 05/05/2019 03:00 PM, but instead I get an error on the End Date calculation.

I think what I need is to take Days and convert it to a Duration type in hours before adding it to Start Date. Is that right? If so, Iโ€™m stuck on how to make that conversion.

My Start Date and Days columns are copied in bulk from an outside scheduler, so I donโ€™t control how they are brought into the table.

Thanks,
TJ

Solved Solved
1 1 517
1 ACCEPTED SOLUTION

TJD
New Member

Ok, well. I slogged it out, with a little nudge from an older post and a mishap or two along the way. Fairly straightforward, once I understood the structure of the duration type.

Virtual Column
Duration
Concatenate([Days]*24,":00:00")

End Date
[Start Date] + [Duration]

View solution in original post

1 REPLY 1

TJD
New Member

Ok, well. I slogged it out, with a little nudge from an older post and a mishap or two along the way. Fairly straightforward, once I understood the structure of the duration type.

Virtual Column
Duration
Concatenate([Days]*24,":00:00")

End Date
[Start Date] + [Duration]

Top Labels in this Space