# YEAR

Extracts the year from the given datetime.

## Syntax

```
YEAR ( dateobj )

```

## Arguments

* dateobj: a valid date, datetime, or parsable date string.

## Return Type

Integer

## Remarks

The `YEAR` function supports improved segment elimination (A process where metadata stored for columnstore segments is used to determine where a segment can match a filter queried at execution time.) when used in `WHERE` clauses. See the following query example:

```sql
SELECT ... FROM table_name WHERE YEAR(column_name) > 2020;
```

## Examples

```sql
SELECT YEAR('2009-02-13');

```

```output

+--------------------+
| YEAR('2009-02-13') |
+--------------------+
|               2009 |
+--------------------+

```

**Related Topics**

* [WEEK](https://docs.singlestore.com/db/v9.1/reference/sql-reference/date-and-time-functions/week.md)
* [WEEKDAY](https://docs.singlestore.com/db/v9.1/reference/sql-reference/date-and-time-functions/weekday.md)
* [MONTH](https://docs.singlestore.com/db/v9.1/reference/sql-reference/date-and-time-functions/month.md)

***

Modified at: May 31, 2023

Source: [/db/v9.1/reference/sql-reference/date-and-time-functions/year/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/date-and-time-functions/year/)

(An index of the documentation is available at /llms.txt)
