Collections:
QUARTER() - Quarter of Year
How to extract the quarter of year from a given date using the QUARTER() function?
✍: FYIcenter.com
QUARTER(date) is a MySQL built-in function that
returns the quarter of year from a given date.
For example:
SELECT QUARTER('2023-02-03'), QUARTER(NOW()), NOW();
-- +-----------------------+----------------+---------------------+
-- | QUARTER('2023-02-03') | QUARTER(NOW()) | NOW() |
-- +-----------------------+----------------+---------------------+
-- | 1 | 4 | 2023-11-15 09:51:50 |
-- +-----------------------+----------------+---------------------+
Reference information of the QUARTER() function:
QUARTER(date): int Returns the quarter of the year for date, in the range 1 to 4. Arguments, return value and availability: date: Required. The date to extract the quarter of year from. int: Return value. The quarter of year. Available since MySQL 4.
Related MySQL functions:
⇐ PERIOD_DIFF() - Difference of Year-Month Periods
2023-11-17, 1208🔥, 0💬
Popular Posts:
Can Date and Time Values Be Converted into Integers in SQL Server Transact-SQL? Can date and time va...
How To Start MySQL Server in MySQL? If you want to start the MySQL server, you can run the "mysqld" ...
How To Verify Your PHP Installation in MySQL? PHP provides two execution interfaces: Command Line In...
How To Install PHP on Windows in MySQL? The best way to download and install PHP on Windows systems ...
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...