Trying to make a duration

Hi, I’m to calculate a duration based on two things that are not durations. I have one column that is a number of “miles remaining” and another that is “my average moving speed”. So I’m dividing the first by the latter to see how many hours I need to travel. But I get a result that is a number and I need to convert it to a duration of hours for the other columns to calculate. Any advice?

A Duration value can be made by generating a text string of the form “hhh:mm:ss”.

Okay, thanks! I’m working on ways to make that work out. It’s difficult because it’s going to involve rounding and quite a bit of concatenating. Maybe this is a feature request for something like DurationHour(), DurationMinute(), DurationSecond(), that would take a number as an input parameter and spit out a duration of hours, minutes, or seconds based on that? So like…
DurationHour(55.5) would come out 055:30:00.

Luke_Vancleave:

Maybe this is a feature request for something like DurationHour(), DurationMinute(), DurationSecond(), that would take a number as an input parameter and spit out a duration of hours, minutes, or seconds based on that? So like…> DurationHour(55.5) would come out 055:30:00.

I think that would be a good idea.

Luke_Vancleave:

But I get a result that is a number and I need to convert it to a duration of hours for the other columns to calculate. Any advice?

Here ya go!

3X_d_5_d51363a862e7ab883241c312ac5d7f271579cdd3.gif

[Convert (Distance ÷ Speed) into Duration](https://community.appsheet.com/t/convert-distance-speed-into-duration/41160) Tips & Tricks ?

concatenate( right(“000” & floor([Time_Remaining]), 3), “:”, right(“00” & number(([Time_Remaining] - floor([Time_Remaining])) * 60), 2), “:00” ) If you take two numbers (miles) and (miles per hour) and divide those two, it will give you a decimal. i.e. 15 miles ÷ 10 mph = 1.5 To convert that decimal result into a duration, it requires a little slicing/and/dicing of the decimal. Here is a sample app that demonstrates what this looks like https://www.appsheet.com/samples/Convert-Di…