cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Void
Level: Power Up

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
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Comparing timevalues in an If function

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
Void
Level: Power Up

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!

Void
Level: Power Up

Re: Comparing timevalues in an If function

Accidentally posted this question twice. My bad!

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Comparing timevalues in an If function

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

Void
Level: Power Up

Re: Comparing timevalues in an If function

Worked out. Thank you very much

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,131)