devxlogo

Finding the Current Quarter in MySQL

Finding the Current Quarter in MySQL

With MySQL, we can find out the quarter by providing a date. In the example below, we will look at the current quarter with input as current date.

Query:

SELECT NOW() as 'TODAY' , QUARTER(NOW()) AS  'QUARTER #';

Sample Output:

+---------------------+-----------+| TODAY               | QUARTER # |+---------------------+-----------+| 2019-09-24 18:29:46 |         3 |+---------------------+-----------+
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist