@IanSL ,
That was a division by zero issue - here is a different approach - this one should work
With(
{
_Calc: DateDiff(
CleanStartDate.SelectedDate + Time(
Value(CleanStartHour.Selected.Value),
Value(CleanStartMinute.Selected.Value),
0
),
CleanEndDate.SelectedDate + Time(
Value(CleanEndHour.Selected.Value),
Value(CleanEndMinute.Selected.Value),
0
),
TimeUnit.Minutes
)
},
With(
{
_Days: RoundDown(
_Calc / 1440,
0
),
_DayMins: Mod(
_Calc,
1440
)
},
With(
{
_Hours: RoundDown(
_DayMins / 60,
0
),
_Minutes: Mod(
_DayMins,
60
)
},
_Days & " Days " & _Hours & " Hours " & _Minutes & " Minutes"
)
)
)
If you simply want the minutes, then just use this
DateDiff(
CleanStartDate.SelectedDate + Time(
Value(CleanStartHour.Selected.Value),
Value(CleanStartMinute.Selected.Value),
0
),
CleanEndDate.SelectedDate + Time(
Value(CleanEndHour.Selected.Value),
Value(CleanEndMinute.Selected.Value),
0
),
TimeUnit.Minutes
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps