cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PVosEska
Level: Powered On

Check is timevalue is between values

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,

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Check is timevalue is between values

@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." 

View solution in original post

PVosEska
Level: Powered On

Re: Check is timevalue is between values

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!

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Check is timevalue is between values

@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." 

View solution in original post

dynamicsedge
Level 8

Re: Check is timevalue is between values

@PVosEska 

 

Try this related solution:

 

Compare two times 

 

PVosEska
Level: Powered On

Re: Check is timevalue is between values

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!

View solution in original post

Helpful resources

Announcements
thirdimage

New Badges

Check it out!

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,207)