title: MySQL first day and last day of current and previous month from date (no timestamp)
body: <p>I hope following query will give you the idea what I am looking for-</p>
  
  <pre><code>SELECT SUM(t1.hours) AS totalhours FROM
  (
      SELECT (time_to_sec(timediff(time_out, time_in)) / 3600) AS hours FROM bb_work_log 
      WHERE user_id = 6 AND (working_date BETWEEN '2014-04-01' AND '2014-04-31')
  ) AS t1
  </code></pre>
  
  <p>In my query, you can see the <code>working_date</code> which I given here manually. But, I would not like to do it manually. I would like to pick first day and last day of current month dynamically.</p>