---
title: add_months function
description: Learn the syntax of the add\_months function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/add_months
---

# `add_months` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns the date that is `numMonths` after `startDate`.

## Syntax

```
add_months(startDate, numMonths)
```

## Arguments

* `startDate`: A DATE expression.
* `numMonths`: An integral number.

## Returns

A DATE.
If the result exceeds the number of days of the month the result is rounded down to the end of the month.
If the result exceeds the supported range for a date an overflow error is reported.

## Examples

```sql
> SELECT add_months('2016-08-31', 1);
 2016-09-30

> SELECT add_months('2016-08-31', -6);
 2016-02-29
```

## Related functions

* [`dateadd` (timestamp) function](https://docs.databricks.com/aws/en/sql/language-manual/functions/dateadd.md)
* [`datediff` (timestamp) function](https://docs.databricks.com/aws/en/sql/language-manual/functions/datediff3.md)
* [`months_between` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/months_between.md)
