title: How to calculate the intersection of two date ranges in VBA?
body: <p>I like to calculate how much one date range overlaps with another data range in VBA (MS-Access).</p>
  
  <p>Sample:  </p>
  
  <blockquote>
    <p>DateRangeA = 5-Jan-15 to 7-Mar-15<br>
    DateRangeB = 3-Feb-15 to 20-June-15  </p>
  </blockquote>
  
  <p>My question: <strong>How much of RangeA is part of RangeB (in percent)?</strong></p>
  
  <p>It is also possible that they don't overlap at all or RangeA is completely inside of RangeB.</p>
  
  <p>I am sure I am able to write code to do this, but probably many people did this already before me and tested their code. </p>
  
  <p>So if you have ready made code then please publish an answer but don’t do the code just for me.</p>
  
  <p>If nobody answers my question within 24 hours then I will write the code myself and publish it.</p>
  
  <p>Thanks</p>