MONTH
Description
The MONTH function is used to extract the month part from a given date value and return the result as an integer.
Parameter Description
- date (date): The date value from which the month needs to be extracted.
Return Result
Returns an integer representing the month part of the date parameter.
Example
- Extract the month from the current timestamp:
- Extract the month from a specified string format date:
- Extract the month from the current timestamp and compare it with the same month last year:
- Extract the month from multiple date values in different formats and summarize the results:
Notes
- When the input parameter is not a valid date value, the MONTH function will return an error.
- Please ensure that the input date format matches the date format supported by the system to avoid parsing errors.