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 filter, sort, and group 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().‌

Syntax

yearweek(appointment)

yearweek(date)

yearweek(timestamp)

Return

‌string‌

Examples

yearweek(myAppointment) To return the week of a year of a given appointment.‌

yearweek(Appointment)

Result: 2021 23

(with Appointment =

  • 06/01/2021 09:00 – 06/16/2022 09:00 (US)

  • 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)

  • 01/06/2021 09:00 – 15/06/2022 09:00 (UK))‌

yearweek(myDate) To return the week of a year of a given date.‌

yearweek(datetime) To return the week of a year of a given timestamp.

See also

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

yearmonth, which returns the month and the year of a given date value.

Last updated