---
title: "YEAR"
description: "The YEAR SQL function extracts the year from a date/time."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/year
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/year
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> YEAR[YEAR]:::quoted
    YEAR --> End((END))
```

## Purpose
The `YEAR` SQL function extracts the year from a date/time.

See also [[DAY]], [[HOUR]], [[MICROSECOND]], [[MILLISECOND]], [[MINUTE]], [[MONTH]], and [[SECOND]].

Parameters:
- Input (`datetime`): the date/time to extract the years from.

Returns: the year as an `int32`.

## Examples
The following example extracts the years from current system date/time in UTC:
```sql
select year(sysdateutc)

-------------------
2026
```
The following example extracts the years from January 1, 2026:
```sql
select year(to_date('20260101', 'YYYYMMDD'))

-------------------
2026
```