Collections:
WEEKOFYEAR() - Calendar Week of Year
How to calculate the calendar week of year from a given date using the WEEKOFYEAR() function?
✍: FYIcenter.com
WEEKOFYEAR(date) is a MySQL built-in function that calculates the calendar week of year from a given date. For example:
SELECT WEEKOFYEAR('2024-03-04'), WEEK('2024-03-04', 3), WEEK('2024-03-04'); -- +--------------------------+-----------------------+--------------------+ -- | WEEKOFYEAR('2024-03-04') | WEEK('2024-03-04', 3) | WEEK('2024-03-04') | -- +--------------------------+-----------------------+--------------------+ -- | 10 | 10 | 9 | -- +--------------------------+-----------------------+--------------------+
Reference information of the WEEKOFYEAR() function:
WEEKOFYEAR(date): int Returns the calendar week of the date as a number in the range from 1 to 53. WEEKOFYEAR() is a compatibility function that is equivalent to WEEK(date,3). Arguments, return value and availability: date: Required. The date to extract the calendar week of year from. int: Return value. The calendar week of year. Available since MySQL 4.
Related MySQL functions:
⇐ WEEKDAY() - Weekday (0=Monday)
2023-11-17, 240🔥, 0💬
Popular Posts:
How To Turn on mysql Extension on the PHP Engine in MySQL? The "mysql" API extension is provided as ...
How To List All Login Names on the Server in SQL Server? If you want to see a list of all login name...
How To Convert Character Strings into Numeric Values in SQL Server Transact-SQL? Sometimes you need ...
How To Convert Numeric Values to Character Strings in MySQL? You can convert numeric values to chara...
How to download and install Microsoft .NET Framework Version 2.0 in SQL Server? .NET Framework Versi...