Hi,
I have two tables (Table1, Table2) containing a 'Year' field (i.e. Values of '1998', '1999', '2000' ..... '2007').
Both are data Source tables.
I have a third (Table3) which I need to update depending on a SELECT DISTINCT YEAR statement form the other two tables. Once I populate Table3 with the Years from Table1, how do I then only add records from Table2 which aren't already contained in Table3.
EXAMPLE
TABLE1
Year
1992
1994
1995
1996
TABLE2
Year
1992
1993
1994
1995
1997
So TABLE3 should contain:
Year
1992
1994
1995
1996
1993
1997
I know the first query is:
Code:
INSERT INTO dbo.TABLE3
(
[Year]
)
SELECT DISTINCT dbo.TABLE1.[YEAR]
FROM dbo.TABLE1
GROUP BY dbo.TABLE1.[YEAR]
But how do I add the values from Table2?
Thanks in advance,
Neal
A Northern Soul