• A calendar table would be good here, although I think the code below should also do the job

    DECLARE@StartDayDATETIME = '20140101',

    @EndDayDATETIME = '20161231';

    WITH DateBase (DT,RN)

    AS

    (

    SELECTA.DT,

    ROW_NUMBER() OVER (PARTITION BY YEAR(A.DT),MONTH(A.DT) ORDER BY A.DT)

    FROM

    (

    SELECTDATEADD(DAY,N,@StartDay)

    FROMdbo.GetNums(0,DATEDIFF(DAY,@StartDay,@EndDay))

    ) AS A(DT)

    WHEREDATEDIFF(DAY,0,A.DT)%7 = 4

    )

    SELECTDB.DT

    FROMDateBase AS DB

    WHEREDB.RN = 1;

    I only checked the first few months in 2014 though. It uses a number table, If you don't have a function for this you can look it up on these forums.