year

To return the year of a given date value

This function provides the year from a date value as a number. You can use this function when calculating year numbers as well as filtering, sorting, and grouping records by year.

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

Syntax

year(date)

year(appointment)

year(timestamp)

Return

number

Examples

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

year(today()) 

Result: 2021

(today =

  • 12/31/2021 (US)

  • 31/12/2021 (UK))

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

year(endof(Appointment))

Result: 2022

(Appointment =

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

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

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

See also

date, which converts to or returns a date value.

day, which returns the day of the month from a given date value as a number.

month, which returns the month from a date value as a number.

quarter, which returns the quarter of a given date value as a number.

week, which returns the calendar week of a given date value.

Do you want to go deeper into the topic? Take a look at the corresponding part of our video tutorial.

Last updated