• Sorry, for being late on this (was waiting for a friend to explain this to me. You know who you are! )

    The reason is fairly simple:

    There are no 0st days in a month

    SELECT CAST(0 AS datetime)

    ------------------------------------------------------

    1900-01-01 00:00:00.000

    (1 row(s) affected)

    That's the first (day one, not zero). So DATEPART(d,7) = 8 and DATEPART(d,8) = 9...

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]