• Hi

    I would advice to use a Tally table:

    DECLARE @Month DATETIME

    SELECT @Month = '2009-02-01'

    SELECT

    N

    FROM Tally

    WHERE

    N <= DATEDIFF(DAY, @Month, DATEADD(MONTH, 1, @Month))

    For sure, this could also be done with a Calendar table.

    Greets

    Flo