You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The YEAR_ISO(ADATE DATE) function handles the first few days of the year but it does not handle the end of the year correctly. For example:
2019-12-30 is ISO year 2020 but returns 2019. My suggestion is:
CASE WHEN DAYOFYEAR(ADATE) <= 7 AND WEEK_ISO(ADATE) >= 52
THEN YEAR(ADATE) - 1
when dayofYear(adate) >= 363 and week_iso(adate) = 1
then year(adate) + 1
ELSE YEAR(ADATE)
end
363 is the earliest day of the year that can be the next year.
The text was updated successfully, but these errors were encountered:
The YEAR_ISO(ADATE DATE) function handles the first few days of the year but it does not handle the end of the year correctly. For example:
2019-12-30 is ISO year 2020 but returns 2019. My suggestion is:
363 is the earliest day of the year that can be the next year.
The text was updated successfully, but these errors were encountered: