# DATE

Extracts the date part from a datetime object.

## Syntax

```
DATE (dateobj)

```

## Arguments

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

## Return Type

Date object. If dateobj is not a valid date, returns ERROR.

## Remarks

The `DATE` 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 examples:

```sql
SELECT ... FROM table_name WHERE DATE(column_name) > '2020-01-01';  
SELECT ... FROM table_name WHERE DATE (column_name) > CURDATE() - 2;    
```

## Examples

```sql
SELECT DATE('2019-01-01 05:06');

```

```output

+--------------------------+
| DATE('2019-01-01 05:06') |
+--------------------------+
| 2019-01-01               |
+--------------------------+

```

**Related Topics**

* [CURRENT\_TIMESTAMP](https://docs.singlestore.com/db/v9.1/reference/sql-reference/date-and-time-functions/current-timestamp.md)
* [CURRENT\_DATE And CURDATE](https://docs.singlestore.com/db/v9.1/reference/sql-reference/date-and-time-functions/current-date-and-curdate.md)
* [Data Types](https://docs.singlestore.com/db/v9.1/reference/sql-reference/data-types.md)

***

Modified at: August 22, 2024

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

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