MSSQLDate/Time FunctionsMONTH
DAY

MONTHDate/Time Functions

YEAR

Returns the month.

Syntax

MONTH(date)

Example

Enter values below to update the example in real time.

order_date
month_part
total_amount
revenue
orders
SELECT MONTH(order_date) AS month_part, SUM(total_amount) AS revenue
FROM orders GROUP BY MONTH(order_date);