web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check is timevalue is ...
Power Apps
Answered

Check is timevalue is between values

(1) ShareShare
ReportReport
Posted on by 329

Hi,

 

I have a SQL-Table with a DateTime Column.

I have a Form in powerapps that splits the column in Dates, hours and minutes

 

I want to automatically Update a textbox on hour and minute values.

 

for example:

If the time is between;

05:45 - 13:44 (Update with value A)
13:45 - 21:44 (Update with value B)
21:45 - 05:45 (Update with value C)

 

Any idea to do this?

 

Regards,

Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @PVosEska 

    Put this formula in the Text property of your label or text input.

     

    With(
     {myTime: Time(drpdown_hour.Selected.Value, drpdown_minute.Selected.Value, 0)},
     If(
     myTime > Time(5,45,0), "C",
     myTime <= Time(5,45,00) And myTime > Time(13,45,0), "A",
     myTime <= Time(13,45,00) And myTime > Time(21,45,0), "B",
     myTime <= Time(21,45,00), "C"
     )
    )

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @PVosEska 

     

    Try this related solution:

     

    Compare two times 

     

  • Verified answer
    PVosEska Profile Picture
    329 on at

    That was a great start @mdevaney ,

     

    The only issue was the time from 00:00 to 05:45. 

    I changed the formula a little, and it works great now.

     

    With(
     {myTime: Time(HourValue1.Selected.Value,MinuteValue1.Selected.Value, 0)},
     If(
     myTime >= Time(00,00,0) And myTime < Time(5,45,00), "N",
     myTime >= Time(5,45,00) And myTime < Time(13,45,0), "O",
     myTime >= Time(13,45,00) And myTime < Time(21,45,0), "M",
     myTime >= Time(21,45,00), "N"
     )
    )

     

     Thanks for the very quick reply!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard