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.
Example
Table 1:
Date1
2016-06-01
2016-06-02
2016-06-03
2016-06-04
2016-06-05
2016-06-06
2016-06-07
Table 2:
Date2
2016-06-01
2016-06-05
2016-06-07
Joined Table
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
Hope that makes sense.
Thanks,
SR
SQL-ServerorMySQL? - Arulkumar