Hi, so I'm making an app to make leave request, I want to have a label show the amount of hours a person is requesting, the company allows to take partial days, so the person can take 1 to 8hs a day I have a date picker with 3 dropdows for start and end of time off that shows Date, Hour and minutes, what calculation can I make to show on a label the amount of hours a person is taking if they select for example, monday at noon to the next tuesday, so that would be a total of 44hs that they are taking
Hi @FGRODRIGUEZ ,
Please try:
With(
{
startTime:DateTimeValue("2023-05-15 13:00:00"),
endTime:DateTimeValue("2023-05-23 9:00:00")
},
Sum(
ForAll(
Sequence(DateDiff(startTime,endTime,TimeUnit.Hours),1,1),
With(
{temp: DateAdd(startTime,Value,TimeUnit.Hours)},
If(Weekday(temp)=1||Weekday(temp)=7||Value(Text(temp,"HH"))<=9||Value(Text(temp,"HH"))>17,0,1)
)
),Value)
)
Best Regards,
Bof
WarrenBelz
413
Most Valuable Professional
MS.Ragavendar
193
stampcoin
149