How to join two tables by using the first relevant date?
<p>I would like to join to two tables using the date as the link, however, I do not want an exact match. The first table has more dates than the second one so I want the match to be dates from the second table to 'closest' date.</p>

<p>Example</p>

<p>Table 1:</p>

<pre><code>Date1
2016-06-01
2016-06-02
2016-06-03
2016-06-04
2016-06-05
2016-06-06
2016-06-07
</code></pre>

<p>Table 2:</p>

<pre><code>Date2
2016-06-01
2016-06-05
2016-06-07
</code></pre>

<p>Joined Table</p>

<pre><code>Date1         Date2
2016-06-01    2016-06-01
2016-06-02    2016-06-01
2016-06-03    2016-06-01
2016-06-04    2016-06-01
2016-06-05    2016-06-05
2016-06-06    2016-06-05
2016-06-07    2016-06-07
</code></pre>

<p>Hope that makes sense. </p>

<p>Thanks,</p>

<p>SR</p>