QUARTER()

Overview

Returns the quarter number for a date.

USAGE

QUARTER(date)

Argument Name

Description

date

The DATE or DATETIME to evaluate

DETAILS

QUARTER() is a date-time function that returns the quarter number for the given date or timestamp.

The return value is in the range 1 to 4 for a valid argument.

The accepted date formats are YYYYMMDD and YYYY-MM-DD, with a wide variety of delineating characters also accepted in addition to dashes.

A NULL is returned if the argument is NULL or otherwise not a valid date.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT QUARTER('2020-02-29'),
       QUARTER('2020-06-30'),
       QUARTER('2019-12-30');
+-----------------------+-----------------------+-----------------------+
| QUARTER('2020-02-29') | QUARTER('2020-06-30') | QUARTER('2019-12-30') |
+-----------------------+-----------------------+-----------------------+
|                     1 |                     2 |                     4 |
+-----------------------+-----------------------+-----------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES