Date Functions - Day / Month / Minutes


--// Show the last date less 1 minute
select DATEADD(MINUTE, -1, DATEADD(DAY,1,getdate()))


--// Show the first day from the last month
Select DateAdd(mm, DateDiff(mm,0,GetDate()), -1) as [Último dia no mês Anterior]


--// Show the last day from the last month
Select DateAdd(mm, DateDiff(mm,0,GetDate()), -1) as [Último dia no mês Anterior]


--// Show the last day from the last month and last minute
Select DATEADD(MINUTE, -1, DATEADD(DAY,1,(DateAdd(mm, DateDiff(mm,0,GetDate()), -1))))