title: SQL Query to select Between two days of the month
body: <p>I want to have a SQL Query that selects between two dates of months.</p>
  
  <p>Lets say between the 15th and the 15th of the next month.</p>
  
  <p>This is for accounting purposes</p>
  
  <p>I know with each month having different days adding 30 days or 31 days to the start date will not work especially in Feb. My accounting run is from the 15th of the month to the 15th of the next month. </p>
  
  <p>My current query for selected dates are as follows</p>
  
  <pre><code>SELECT * FROM lbs_trace_etrack WHERE lbs_date  &gt;=  '" . $dates . "' 
  AND lbs_date  &lt;= '" . $datee . "' AND lbs_client='$slcustom1' ORDER BY lbs_date DESC, lbs_time DESC
  </code></pre>
  
  <p>lbs_date start should be the 15th of each month and lbs_date end should be the 15th of the next month</p>
  
  <p>By defining the dates as follow works but it is giving me from the November date to now and I want it from the 15th of this month seeing we have past the 15th of the current month already</p>
  
  <pre><code>$first = date('Y-m-15', strtotime("$last -1 month"));
  $last = date('Y-m-t'); 
  </code></pre>
  
  <p>and the query</p>
  
  <pre><code>SELECT * FROM lbs_trace_etrack WHERE lbs_date  &gt;=  '" .    
  $first . "' 
  AND lbs_date  &lt;= '" . $last . "' ORDER BY lbs_date DESC
  </code></pre>
  
  <p>Basically as we pass the current month 15th I need it to show me the current usage from the current 15th not the previous month 15th to now</p>