• Here is the logic to find the fiscal calendar year for those days at the beginning of January that are part of the last week in the previous year. The cte just builds a column full of dates for testing so you can adjust the top and start date as needed for testing.

    with dates as (select top 2100

    dateadd(day,row_number() over (order by (select null))-1,'1/1/2015') as dt

    from master.sys.columns c1

    cross join master.sys.columns c2)

    select dt,

    year(dt)-1 as fiscal_calendar_year,

    datename(dw,dt) as day_name

    from dates

    where month(dt) = 1

    and datepart(dw,dt) > day(dt);

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato