Get DateTime Now
GETDATE() -- 2011-09-15 13:45:00.923
Calculate the difference in the month from '1900-01-01'
DATEDIFF(m, 0, GETDATE())
Add the difference to "1900-01-01" plus one additional month
DATEADD(m, DATEDIFF(m, 0, GETDATE())+1, 0) -- 2011-10-01 00:00:00.000
Delete one second
DATEADD(s, -1, DATEADD(m, DATEDIFF(m, 0, GETDATE())+1, 0)) -- 2011-09-30 23:59:59.000
source share