Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 888 Bytes

File metadata and controls

37 lines (27 loc) · 888 Bytes
description
Returns the day of month of the date or timestamp.

DAY

Syntax

DAY(date_timestamp_expression string) → bigint

  • date_timestamp_expression: A DATE or TIMESTAMP expression.

Examples

{% code title="DAY example" %}

SELECT "DAY"('2003-02-01 11:43:22')
-- 1

{% endcode %}

{% code title="DAY example" %}

SELECT "Date", "DAY"("Date") 
FROM eth.recent_blocks  
LIMIT 3

-- Date, EXPR$1
-- 2016-01-29, 29
-- 2016-01-29, 29
-- 2016-04-25, 25

{% endcode %}

Usage Notes

The function name is a Spice keyword and must be enclosed in double quotes ("DAY"). This function is identical to the function DAYOFMONTH.