Updated on 2026-11-06 GMT+08:00
quarter
The quarter function is used to return the quarter in which the date falls, ranging from 1 to 4.
Syntax
quarter(string date)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| date | Yes | DATE or STRING | The date to be processed. Formats:
|
Return Values
Returns a value of type INT.
- If date is not of type DATE or STRING, an error is returned with the message "data type mismatch".
- If date is of type DATE or STRING but does not conform to the input format for date values, NULL is returned.
- If the date value is NULL, NULL is returned.
Example Code
Returns 3.
select quarter('2023-08-16 10:54:00'); Returns 3.
select quarter('2023-08-16'); Returns NULL.
select quarter(null);
Parent topic: Date Functions
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot