Parameter | Type |
---|---|
value | datetime, date, datetimestamp, gyear, gyearmonth |
Returns: integer
Example
query:
SELECT DAY(CAST("2018-01-02" AS DATE))
results:
day |
---|
2 |
The date function used to return the day value of a date, time, or datetime value.
Parameter | Type |
---|---|
value | datetime, date, datetimestamp, gyear, gyearmonth |
query:
SELECT DAY(CAST("2018-01-02" AS DATE))
results:
day |
---|
2 |
AT_TIME_ZONE
, DATE_ADD
, DATE_COMPARE
, DATE_DIFF
, DATE_FORMAT
, DATE_PARSE
, DATE_PART
, DATE_SUB
, DATE_TRUNC
, HOURS
, MINUTES
, MONTH
, NOW
, SECONDS
, YEAR