How to get End of the Month in SQL SERVER

How to get End of the Month in SQL SERVER still the popular question always. To find the last day of each month it is a similar question. I excited to answering it as the following.

To to get End of the Month in SQL SERVER I always use the EOMONTH to Calculate the End of the Month as the following script:

DECLARE @date date
SET @date = '2017-08-31'
SELECT EOMONTH ( @date ) AS LAST_DATE_AUG


When you excecute it and it's should show as following screen result.


Share on Google Plus
If you think this article is helpful don't froget share it to your friends.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment