29.7. Weeks
Weeks are not part of the SQL temporal functions, but they are part of ISO-8601 Standards. While it is not as common in the United States as it is in Europe, many commercial and industrial applications use the week within a year as a unit of time.
Week 01 of a year is defined as the first week that has the Thursday in that year, which is equivalent to the week that contains the fourth day of January. In other words, the first week of a New Year is the week that has the majority of its days in the New Year. Week 01 might also contain days from the previous year, so it does not align with the years.
The standard notation uses the letter ‘W’ to announce that the following two digits are a week number. The week number component of the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access