MONTH

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the month field from a timestamp or interval. This function is equivalent to EXTRACT(MONTH FROM ...).

Syntax 

1month(<timestamp>)
1month(<interval>)

Arguments 

Required 

  • <timestamp>: The timestamp to extract the month from.
  • <interval>: The interval to extract the number of months from.

Returns 

Returns the month as an integer.

Examples 

Extract the Month from a Timestamp 

Get the month of the year from a timestamp.

1SELECT month(timestamp '2001-02-16 20:38:40') AS result;

Returns 2.

Extract the Month from an Interval 

Get the number of months from an interval.

1SELECT month(interval '6 months') AS result;

Returns 6.

Related Documentation 

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!