Retrieve the quarter of the year for a given date.
SELECT QUARTER(“2017-06-15”); |
The QUARTER() function returns the quarter of the year (1 to 4) corresponding to a given date value.
QUARTER(date) |
Parameter |
Description |
date |
Mandatory: The date or datetime from which to extract the quarter. |
Works in: |
From MySQL version 4.0 |
Retrieve the quarter of the year for a specified date.
SELECT QUARTER(“2017-01-01 09:34:21”); |
Retrieve the quarter of the year corresponding to the given date.
SELECT QUARTER(CURDATE()); |