Q&A for experienced flyers, pilots, and builders of drones and model aircraft
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0) As First_Of_Current_Month , DateAdd(dd, -1, DateAdd(mm, DateDiff(mm, 0, GETDATE()) +1, 0)) As Last_Of_Current_Month , DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-1, 0) As First_Of_Last_Month , DATEADD(MONTH, DATEDIFF(MONTH, -1, GETDATE()) -1, -1) As Last_Of_Last_Month , DATEADD(mm, DATEDIFF(mm, 0, GETDATE())-15, 0) as test , DATEADD(year, DATEDIFF(year, +1, GETDATE()) +2, -1) as Last_day_of_upcomming_year;