• Here is some code for you all to play with. Use at your own risk. I tested this with my Tally table.

    create function dbo.tvf_EOM (

    @iDate datetime

    )

    returns table

    as

    return select

    dateadd(mm, datediff(mm, 0, @iDate) + 1, -1) as EndOfThisMonth,

    datename(dw,dateadd(mm, datediff(mm, 0, @iDate) + 1, -1)) as DatenameEndOfThisMonth;

    go

    select

    dateadd(dd, t.N - 1, 0) as TheDate,

    EndOfThisMonth,

    DatenameEndOfThisMonth

    from

    dbo.Tally t

    cross apply dbo.tvf_EOM(dateadd(dd, t.N - 1, 0))

    where

    t.N between datediff(dd, 0, getdate()) and datediff(dd, 0, getdate()) + 120;