First day of next month: Get the first day of the current month and add 1 month?
SELECT DATEADD(mm, DATEDIFF(m, 0, GETDATE()), 0); Logic: DATEDIFF(m, 0, GETDATE()) calculates the number of months between the base date (0 which translates to '1900-01-01') and the current date (GETDATE()). DATEADD(mm, , 0) then adds this number of months to the base date, effectively giving the first day of theā¦
Answered May 27, 2024 · 75.7K Views Read answer →