title: Date Stored Procedure
body: <p>I'm looking to setup a calendar date stored procedure in Mysql. The purpose is to be able to select the first day and last day of a given month by call the procedure.  I know it is probably a very simple thing that I am missing. Below is what I have tried.</p>
  
  <pre><code>CREATE PROCEDURE CalendarDate
          @startdate DATE,
          @enddate DATE
      AS
  SELECT
      (SELECT DATE_ADD(DATE_ADD(LAST_DAY(CURDATE()),interval 1 DAY),interval -1 MONTH)) AS startdate
  ,   (SELECT LAST_DAY(CURDATE())) AS enddate
  ;
  </code></pre>
  
  <p>I would like to use the above to be able run a query by just saying:</p>
  
  <pre><code>SELECT *
  FROM mytable
  WHERE action_date BETWEEN @startdate AND @ endate
  </code></pre>