> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# years_add

> DATETIME YEARS_ADD(DATETIME expr1,INT expr2)

## description

### Syntax

```Haskell theme={null}
DATETIME YEARS_ADD(DATETIME expr1,INT expr2)
```

Add a specified time interval to the date. Unit is year.

The expr1 parameter is a valid datetime expression.

The expr2 parameter is the years you want to add.

## example

```Plain Text theme={null}
select years_add('2010-11-30 23:50:50', 2);
+-------------------------------------+
| years_add('2010-11-30 23:50:50', 2) |
+-------------------------------------+
| 2012-11-30 23:50:50                 |
+-------------------------------------+

select years_add('2010-11-30', 2);
+----------------------------+
| years_add('2010-11-30', 2) |
+----------------------------+
| 2012-11-30 00:00:00        |
+----------------------------+
```

## keyword

YEARS\_ADD,ADD


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.