I need to convert a datetime field to the 1st day of the next month. My sql below
works to change the day or month but I want the month and day changed in one statement. Thanks.
declare @newdate datetime,
set @olddate = '2015-05-10' -- want this to be '2015-06-01' as @newdate
set @newdate = DATEADD(m,1,@olddate) ---adds 1 to month
set @newdate = dateadd(dd, -DAY(@olddate) + 1, @olddate) --sets day to 1