SQL Date Function MONTH()

‮:sptth‬//www.theitroad.com

The MONTH() function is a SQL function used to extract the month component of a date or datetime value. It takes one argument, which is the date or datetime value from which the month component will be extracted.

Here's an example of how to use the MONTH() function in a SQL query:

SELECT MONTH('2022-02-28');

This query will return the integer value 2, which is the month component of the date "2022-02-28".

Note that the MONTH() function is specific to the database management system you are using, and the syntax and date format it supports may vary slightly depending on the system. Additionally, the MONTH() function only extracts the month component of a date or datetime value, and does not take into account other components such as the year or day.