This function is used to return the quarter of a date. The value ranges from 1 to 4.
quarter(string date)
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
date |
Yes |
DATE or STRING |
Date that needs to be processed The following formats are supported:
|
The return value is of the INT type.
The value 3 is returned.
select quarter('2023-08-16 10:54:00');
The value 3 is returned.
select quarter('2023-08-16');
The value NULL is returned.
select quarter(null);