• The integer value for the first day of the month is even easier:

    SELECT BOM = @ThisYear * 10000 + @ThisMonth * 100 + 1,

    but you must CAST it to char(8) before storing it in a date/datetime column.

    DECLARE @BOM datetime

    SELECT @BOM = CAST(@ThisYear * 10000 + @ThisMonth * 100 + 1 AS char(8))

    SELECT @BOM

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.