Monday, March 25, 2019

SQL SERVER - How to get end of month date

select eomonth( getdate(), -1 )
select eomonth( getdate() )    
select eomonth( getdate(), 1 )
Output:
----------
2019-02-28

(1 row(s) affected)


----------
2019-03-31

(1 row(s) affected)


----------
2019-04-30

(1 row(s) affected)

No comments:

Post a Comment