WEEK(), WEEKOFYEAR()
WEEK(), WEEKOFYEAR() — Returns the week of the year as an integer value.
Synopsis
WEEK( timestamp-or-date )
WEEKOFYEAR( timestamp-or-date )
Description
The WEEK() and WEEKOFYEAR() functions are synonyms and return an integer value between 1 and 52 representing the date
or timestamp's week of the year. These functions produce the same result as using the WEEK_OF_YEAR keyword with the
EXTRACT() fucntion.
Examples
The following example uses the WEEK() function to group and sort records containing a timestamp.