Hello everybody
I want to determine a text label based on a time.
6:00 - 14:00 = early shift
14:00 - 22:00 = day shift
22:00 - 6:00 = night shift
Who can help me here?
Solved! Go to Solution.
How about this approach :
With({currentTime:TimeValue(TextInput2.Text)},
If(
currentTime > TimeValue("6:00") && currentTime < TimeValue("14:00"),
"Early shift",
currentTime > TimeValue("14:00") && currentTime < TimeValue("22:00"),
"Day shift",
"Night shift"
)
)
@eka24 - please excuse my interferance !
You can consider these steps:
1. Insert a Timer Control and Set the following properties:
Autostart: true
OnTimerEnd: UpdateContext({RefreshTimer: Now()})
Repeat: true
Duration: 60000
2. Insert a Textbox2 and on Default RefreshTimer
3. In your Label text property:
If(
TimeValue(TextInput2.Text) > TimeValue("6:00") And TimeValue(TextInput2.Text) < TimeValue("14:00"),
"Early shift",
If(
TimeValue(TextInput2.Text) > TimeValue("14:00") And TimeValue(TextInput2.Text) < TimeValue("22:00"),
"Day shift",
If(
TimeValue(TextInput2.Text) > TimeValue("22:00") And TimeValue(TextInput2.Text) < TimeValue("24:00"),
"Night shift",
If(
TimeValue(TextInput2.Text) > TimeValue("1:00") And TimeValue(TextInput2.Text) < TimeValue("6:00"),
"Night shift"
)
)
)
)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
@eka24
Works partially!
Between 22:00 and 0:59 I don't get anything displayed. before and after it works great
What is 0.59, are you referring to minutes at what time?
You can also add minutes like 6:03 to the formula.
Explain further
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
How about this approach :
With({currentTime:TimeValue(TextInput2.Text)},
If(
currentTime > TimeValue("6:00") && currentTime < TimeValue("14:00"),
"Early shift",
currentTime > TimeValue("14:00") && currentTime < TimeValue("22:00"),
"Day shift",
"Night shift"
)
)
@eka24 - please excuse my interferance !
anything between 22:00 PM to 1:00 AM is not displayed
@gabibalaban the idea works
I have made some changes:
If(
TimeValue(TextInput2.Text) > TimeValue("6:00") And TimeValue(TextInput2.Text) <= TimeValue("14:00"),
"Early shift",
If(
TimeValue(TextInput2.Text) > TimeValue("14:01") And TimeValue(TextInput2.Text) <= TimeValue("22:00"),
"Day shift",
If(
TimeValue(TextInput2.Text) > TimeValue("22:01") And TimeValue(TextInput2.Text) <= TimeValue("23:59"),
"Night shift",
If(
TimeValue(TextInput2.Text) >= TimeValue("0:59") And TimeValue(TextInput2.Text) <= TimeValue("6:00"),
"Night shift"
)
)
)
)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Unfortunately, the idea doesn't work at all.
the idea from @gabibalaban works perfectly
User | Count |
---|---|
261 | |
110 | |
89 | |
53 | |
44 |