title: How to find status between dates
body: <p>I have table like this:</p>
  
  <pre><code>Number  |Status     |Start_Date 
  ------------------------------------
  A       |Active     |2016-11-29 22:51
  A       |blocked    |2016-12-20 22:51
  A       |Active     |2017-01-09 22:51
  A       |blocked    |2017-01-29 22:51
  </code></pre>
  
  <p>My goal is when I declare date, to find  status on <code>A</code> number </p>
  
  <p>For example:</p>
  
  <pre><code>Declare @Date varchar(25)='2017-01-10 12:40'
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>Number  |Status     |Date 
  ------------------------------------
  A       |Active     |2017-01-10 12:40
  </code></pre>
  
  <p>Because <code>2017-01-10 12:40</code> is between <code>2017-01-09 22:51</code> and  <code>2017-01-29 22:51</code>
  then status is <code>Active</code></p>
  
  <p>But I don't know how to find status for Declare Date</p>