MySQL has a lot of DATE and TIME related functions. If you want to find out the last day of the month, all you need to do is to use the inbuilt function names LAST_DAY.
Here’s an example:
SELECTÂ LAST_DAY(@date)Â ASlast_day;
The above code will return a value: 2014-08-31
The problem is, there is no inbuilt function to find out the first day for a month. In this method, we’ll discuss the two methods to display the first day of the month. We’ll use the DATE_ADD and LAST_DAY function and the DATE_ADD and DAY functions.
Read the rest of the post here:Â http://blog.sqlauthority.com/2014/04/09/mysql-finding-first-day-and-last-day-of-a-month/