Reminder.
Source
SELECT GETDATE() 'Today'
SELECT DATEADD(d,-1,GETDATE()) 'Yesterday'
SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) 'Start of Current Day'
SELECT DATEADD(ms,-3,DATEADD(dd,DATEDIFF(dd,0,GETDATE()),1)) 'End of Current day'
SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE()),-1) 'Start of Yesterday'
SELECT DATEADD(ms,-3,DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0)) 'End of Yesterday'
SELECT DATEADD(dd,7*(DATEDIFF(dd,'1973-01-01',GETDATE())/7),'1973-01-01') 'First day of current ISO Week'
SELECT DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0) 'First Day of Current Week'
SELECT DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6) 'Last Day of Current Week'
SELECT DATEADD(wk,DATEDIFF(wk,7,GETDATE()),0) 'First Day of Last Week'
SELECT DATEADD(wk,DATEDIFF(wk,7,GETDATE()),6) 'Last Day of Last Week'
SELECT DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0) 'First Day of Current Month'
SELECT DATEADD(ms,- 3,DATEADD(mm,0,DATEADD(mm,DATEDIFF(mm,0,GETDATE())+1,0))) 'Last Day of Current Month'
SELECT DATEADD(mm,-1,DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)) 'First Day of Last Month'
SELECT DATEADD(ms,-3,DATEADD(mm,0,DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0))) 'Last Day of Last Month'
SELECT DATEADD(qq,DATEDIFF(qq,0,GETDATE()),0) 'First Day of Current Quarter'
SELECT DATEADD(yy,DATEDIFF(yy,0,GETDATE()),0) 'First Day of Current Year'
SELECT DATEADD(ms,-3,DATEADD(yy,0,DATEADD(yy,DATEDIFF(yy,0,GETDATE())+1,0))) 'Last Day of Current Year'
SELECT DATEADD(yy,-1,DATEADD(yy,DATEDIFF(yy,0,GETDATE()),0)) 'First Day of Last Year'
SELECT DATEADD(ms,-3,DATEADD(yy,0,DATEADD(yy,DATEDIFF(yy,0,GETDATE()),0))) 'Last Day of Last Year' <font color="#111111" face="Segoe UI, Arial, sans-serif"><span style="font-size: 14px"> </span></font>
SELECT DATEADD(dd,7*(DATEDIFF(dd,'1973-01-01',GETDATE())/7),'1973-01-01') Date_Week
<font color="#111111" face="Segoe UI, Arial, sans-serif"><span style="font-size: 14px">
</span></font>