yearweek

To return the week and the year of a given date value‌

You will get the year and the week from a given date value displayed in the format “YYYY WW”. This can help you filtering, sorting, and grouping records.‌

If you use the function for an appointment field, Ninox returns the start date of this appointment. If you need the end date of an appointment specify with endof().‌

Return

‌string‌

Examples

yearweek(myAppointment) To return the week of a year of a given appointment, e.g. "2021 23".‌

yearweek(Appointment)

Result: 2021 23 (with “Appointment”: 06/01/2021 09:00 – 06/16/2022 09:00 (US) and 01/06/2021 09:00 – 15/06/2022 09:00 (UK))

yearweek(endof(Appointment))

Result: 2022 24 (with “Appointment”: 06/01/2021 09:00 – 06/16/2022 09:00 (US) and 01/06/2021 09:00 – 15/06/2022 09:00 (UK))‌

yearweek(myDate) To return the week of a year of a given date, e.g. "2021 23".‌

yearweek(datetime) To return the week of a year of a given timestamp, e.g. "2021 23".

Check also

‌​yearquarter, which returns the quarter and the year of a given date value and yearmonth, which returns the month and the year of a given date value.