Welcome to Snipped, a code gallery for creating, saving and sharing all kinds of code snippets.

Get the last day of the month

SQL · February 16, 2017 6:31 pm

0 0 70

If you do not have 4.xx yet here is a simple way to get the last day of the month. You can replace the current date with a var to find the last day of any month.

SELECT SUBDATE( ADDDATE( CURDATE(), INTERVAL 1 MONTH), INTERVAL DAYOFMONTH( CURDATE() ) DAY) AS LAST_DAY_MONTH

Discuss this Snip
    No Discussion Comments found.

    You must be Signed In to discuss this Snip
Snipped

Snipped

Joined on
February 16, 2017

  • 9 Snips
    Contributed
  • 0 Likes
    Given
  • 0 Comments Posted
Snip Tags
Get Social And Share

Manage and share all of your code snippets in one easy place.