title: Create a join on range from one table to a value from another table SQL server
body: <p>So, I need to write a join between two tables whose structures are as below.</p>
  
  <p><a href="https://i.stack.imgur.com/PiZm4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PiZm4.jpg" alt="enter image description here"></a></p>
  
  <p>The user will provide the value BATCHID and this will get the corresponding value of VARIABLENAME which has two properties BATCHSTART and BATCHEND which are of type datetime. Now the condition is that the value of TIMESTAMP from the table NUMERICLOG should lie in between VARIABLENAME.BATCHSTART and VARIABLENAME.BATCHEND.</p>
  
  <p>Now, because there is no common column between the two tables, I am not able to figure out how to do this. </p>
  
  <p>Since, I don't have much experience with database queries, am I missing something very obvious? Please help.</p>