cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Comparing timevalues in an If function

Hello,

 

I am trying to compare two hourvalues inside a if function. I thought it would work the same way as comparing two dates with each other, but it keeps telling me that it is expecting a number value. I tried using hourvalue.selected and .selected.value, but none of them seems to work. Is it even possible to compare times in powerapps or am I missing something?

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

If the type of the data is text, then you can use the Value function to convert that to a number, something along the lines of

If(
    Value(hourvalue.Selected.Value) > Value(hourvalue2.Selected.Value),
    "First is greater",
    "Equal or second is greater")

View solution in original post

4 REPLIES 4
Highlighted
New Member

Hello,

 

I am trying to compare two hourvalues inside a if function. I thought it would work the same way as comparing two dates with each other, but it keeps telling me that it is expecting a number value. I tried using hourvalue.selected and .selected.value, but none of them seems to work. Is it even possible to compare times in powerapps or am I missing something?

 

Thanks in advance!

Highlighted

Accidentally posted this question twice. My bad!

Highlighted
Power Apps
Power Apps

If the type of the data is text, then you can use the Value function to convert that to a number, something along the lines of

If(
    Value(hourvalue.Selected.Value) > Value(hourvalue2.Selected.Value),
    "First is greater",
    "Equal or second is greater")

View solution in original post

Highlighted

Worked out. Thank you very much

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (2,229)