DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Writing

Q&A for the craft of professional writing, including fiction, non-fiction, technical, scholarly, and commercial writing

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(mm,DATEDIFF(mm,0,dateadd(month,-1,getdate())),0) As First_Of_Last_Month
  , dateadd(ms,-3,DATEADD(mm,DATEDIFF(mm,0,getdate()),0)) As Last_Of_Last_Month;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results