title: How to select data between given interval of time from SQL
body: <p>I have following data in SQL <a href="https://i.stack.imgur.com/Lmiro.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lmiro.jpg" alt="SQL Data i am having"></a></p>
  
  <p>Need sql queue:</p>
  
  <p>I have 10 tags, it is continuously logging to SQl at every 10 Seconds of intervals.
  Now i want create report like.....User will provide time interval and tag name on that basis it will select data from table &amp; display in Excel
  Suppose My inputs are :
  <em>interval is</em> <strong>2016-09-21 14.00.00</strong> to <strong>2016-09-21 22.00.00</strong>
  <em>Tag Name is</em> : <strong>system\Year</strong>
  I want following output:<a href="https://i.stack.imgur.com/4aI81.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4aI81.jpg" alt="output result"></a>
  <strong>Suppose record is not present at that time, then i need blank/Zero value.</strong>
  I want to create this in VB6.</p>