title: how to show the split the days of between two months
body: <p>I have a table with columns <code>empname,fdate,tdate,totleave</code></p>
  
  <p>If the employee takes a leave from 28th January to 2nd February, totally 5 days leave, while preparing the salary, I want to retrieve the January leave days only, that 3 days only I want to retrieve, the remaining days of February will be retrieved in the month of February, can you tell me how to write the query for this.</p>
  
  <p>This is my query but it is wrong</p>
  
  <pre><code>select ((month(tdate )) - (day(fdate ))) as no_of_days,month(fdate )as month 
  from leavedepot  
  </code></pre>