Skip to main content

DAY

Description

Obtain the day information from the date, with return values ranging from 1 to 31.

Alias

  • dayofmonth

Syntax

DAY(<dt>)

Parameters

ParameterDescription
<dt>A valid date expression

Return Value

Returns the day information from the given date.

Examples

select day('1987-01-31');
+----------------------------+
| day('1987-01-31 00:00:00') |
+----------------------------+
| 31 |
+----------------------------+