• That's quite a mess, isn't it!

    The only correct answer is "none of the above", for two reasons:

    1) none of the select statements is syntactically valid.

    2) even when the missing parentheses are added to make them syntactically valid, none of them will return 31.12.2012 on 31st Jan 2013 because February doesn't have 31 days this year.

    If you want a select statement that does what is sepcified, the simple approach is

    select dateadd(day,-datepart(day,GETDATE()),GETDATE())

    edit: I see Hugo posted a better method with only one getdate() call and returning a date without any time.

    Tom