on 11-30-2020 3:47 PM
Hi All,
Looking for a way to count the number of Sundays in the current month via a variable?
e.g. Today = 30/11/2020, Days in month = 30 & Sundays in month = 5
Thanks for any help.
Define the following variables:
exDate: =ToDate("13.10.2020"; "dd.MM.yyyy")
Note: This an example date, and you can put other date or use CurrentDate()
lastDayOfMonth: =LastDayOfMonth([exDate])
DayNrOfWeek_LastDayOfMonth: =DayNumberOfWeek([lastDayOfMonth])
DateOfLastSundayOfMonth: =If ([DayNrOfWeek_LastDayOfMonth] = 7) Then [lastDayOfMonth] Else RelativeDate([lastDayOfMonth]; -[DayNrOfWeek_LastDayOfMonth])
DayOfMonthLastSunday: =DayNumberOfMonth([DateOfLastSundayOfMonth])
NoOfSunday: =Ceil(([DayOfMonthLastSunday]) / 7)
...
Result example for different months:
...
Hope this gives you an idea of how to meet the requirements
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.