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

# `make_date` 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

Creates a date from `year`, `month`, and `day` fields.

## Syntax

```
make_date(year, month, day)
```

## Arguments

* `year`: An INTEGER expression evaluating to a value from 1 to 9999.
* `month`: An INTEGER expression evaluating to a value from 1 (January) to 12 (December).
* `day`: An INTEGER expression evaluating to a value from 1 to 31.

## Returns

A DATE.

In Databricks SQL, if any of the arguments is out of bounds, the result is `NULL`.
In Databricks Runtime, if any of the arguments are out of bounds, Databricks raises [DATETIME\_FIELD\_OUT\_OF\_BOUNDS](https://docs.databricks.com/aws/en/error-messages/datetime-field-out-of-bounds-error-class.md) unless [spark.sql.ansi.enabled](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-ansi-compliance.md) is `false`, in which case the function returns `NULL`.

## Common error conditions

* [DATETIME\_FIELD\_OUT\_OF\_BOUNDS](https://docs.databricks.com/aws/en/error-messages/datetime-field-out-of-bounds-error-class.md)

## Examples

```sql
> SELECT make_date(2013, 7, 15);
 2013-07-15
> SELECT make_date(2019, 13, 1);
 NULL
> SELECT make_date(2019, 7, NULL);
 NULL
> SELECT make_date(2019, 2, 30);
 NULL

-- In DBR with ANSI mode, out-of-bounds fields raise an error.
> SELECT make_date(2024, 13, 1);
  Error: DATETIME_FIELD_OUT_OF_BOUNDS
```

## Related functions

* [`make_timestamp` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/make_timestamp.md)
* [`make_interval` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/make_interval.md)
