Hi all,
I have two datepickers, one for the start date of a project and one for the end date. Now I need to determine the number of saturdays and sundays between these two days, because additional costs apply here. However I don't know how to calculate it.
I hope someone can help me!
Kind regards
CountIf(
ForAll(
Sequence(DateDiff(DatePicker1.SelectedDate, DatePicker2.SelectedDate,TimeUnit.Days)+1,0,1) As dateRange,
DateAdd(DatePicker1.SelectedDate,dateRange.Value,TimeUnit.Days)
),
Weekday(Value)=1 || Weekday(Value)=7
)
Hi,
Try this formula in label text property
RoundDown(DateDiff(DatePicker1.SelectedDate, DatePicker2.SelectedDate, TimeUnit.Days) / 7, 0) * 2 +
If(Weekday(DatePicker1.SelectedDate) = 1, 1, 0) +
If(Weekday(DatePicker1.SelectedDate) = 7, 1, 0) +
If(Weekday(DatePicker2.SelectedDate) = 1, 1, 0) +
If(Weekday(DatePicker2.SelectedDate) = 7, 1, 0)
Thanks!
If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.
Hi! This will find the count of saturdays and sundays in between your 2 selected dates, and store it as a variable "SatSunCount", and can be relatively easily modified to get other information from between these 2 dates:
Set(
SatSunCount,
CountIf(
ForAll(
Sequence(
DateDiff(
DatePicker1.SelectedDate,
DatePicker2.SelectedDate
)
),
Text(
DatePicker1.SelectedDate + Value,
"dddd"
)
),
ThisRecord.Value = "Saturday" || ThisRecord.Value = "Sunday"
)
)
Hope this helps!