Mysql Date Quarter

Mysql Date Quarter is a query in SQL that is used to show Quarter date range from 1 to 4.

Mysql Date Quarter

Mysql Date Quarter

     

Mysql Date Quarter is a query in SQL that is used to show Quarter date range from 1 to 4.

Understand with Example

The Tutorial illustrate an example from Mysql Date Quarter. To understand and grasp this example we show you a range depend upon the month. 

Month Range:  

   Month  Range

Jan-March 1
April-Jun 2
July-Sept 3
Oct-Dec 4

Query to show Quarter  date range 1 to 4 :

The QUARTER is used to provide a range value from '1-4' obtained by dividing the total number of months in a year divided by 1/4.

mysql> SELECT QUARTER('2009/01/08 02:20:00');
+--------------------------------+
| QUARTER('2009/01/08 02:20:00') |
+--------------------------------+
| 1 |
+--------------------------------+
1 row in set (0.00 sec)