Monday, November 28, 2016

SQL First Date and Last date of current month

To get first date of current month use below sql query :

select  CAST(DATEADD(dd,-(DAY(getDate())-1),getDate()) as date) ,'First Date of current Month'
union
CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,getDate()))),'Last day of Current month'