Reputation: 11
Week number of 2021 starts with 53. I would want it to be 1. Every year week number has to reset and start with 1.
Example below query returns 1 in sql
select datepart(week,'2021-01-01')
But select week('2021-01-01'::date) return 53 in Snowflakes. I need the result to be 1 in snowflakes.
Upvotes: 0
Views: 2474
Reputation: 11
alter session set week_of_year_policy=1;
Added this before my query in snowflakes and now week number starts with 1 for year 2021.
Upvotes: 1