'how do i extract both the week and year off a date, and have it as week1, 2022 or week40, 2021

I initially extracted the weeks from a date as 1, 2, 3 using the extract clause but now, I want to have the year along with it as week1, 2022 or week 40, 2021



Solution 1:[1]

Use below

select format_date('week%W, %Y', current_date())          

with output as

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mikhail Berlyant