title: Select the number of days a record is present within a certain year/month
body: <p>In sql server I have a table with start and end dates for job postings. Given a month and a year by the user I need to find the amount of days between the start and end date that fall in the given year/month for that posting.</p>
  
  <p>So if the posting Start Date is 2010/11/15 and End Date is 2010/12/05
  Then output should be:</p>
  
  <pre><code>November  16 days
  December  5 days
  Total     21 days
  </code></pre>
  
  <p>I've been beating my head against the wall with this one and am fresh out of ideas.</p>