title: Join two data tables to override values by date range
body: <p>I want to correct one table based of of the overrides in another table. I want to change the value in dt_current when dt_override has that unit and the date ranges overlap with dt_current.</p>
  
  <pre><code>dt_current &lt;- data.table( unit = c(rep("a",10), rep("b", 10)), 
      date = seq(as.Date("2015-1-1"), by = "day", length.out = 10), 
      num = 1:10, key = "unit")
  dt_override &lt;- data.table( unit = c("a", "a", "b", "zed" ), start_date = as.Date(c("2015-01-03", "1492-12-25", "2015-01-02", "2015-01-11")), 
      end_date = as.Date(c("2015-01-05", "1492-12-26", "2015-01-04", "2015-01-14")), 
      value = NA, key = "unit")
  </code></pre>
  
  <p>It seems like I should use some form of .EACHI when joining the two data tables, coded something like the following, thought it doesn't work or course.</p>
  
  <pre><code>dt_current[dt_override, 
      num := if(i.start_date &lt;= date &amp; i.end_date &gt;= date) i.value, 
      by = .EACHI]
  </code></pre>