SQL QUARTER is a MySQL function which also supported by Ingres database. It will return the quarter of a date expression as an integer (in the range of 1-4).
SQL QUARTER Syntax
SELECT QUARTER(date-expression)
SQL QUARTER Example
SELECT QUARTER(NOW()) AS QT
The result will look like: (suppose it’s 2011-11-05 now)
QT |
---|
4 |
SELECT QUARTER('2012-08-03') AS QT
The result will look like:
QT |
---|
3 |