Hello,
I need to append a table w/ only unique records. I have my master table and my table im using to add the new records from, the layouts are the same in both tables. i get the data for the new table by importing data from an excel sheet that comes from our work system and i hope to append this data to the master table to add any new records. The table names are:
Master Table - tbl_All_WIGIs
Table im using to update Master Table - tbl_WIGI_TEST
Unique Value - Emp_ID
I want to import all columns from the tbl_WIGI_Test table into the tbl_All_WIGIs and this is what i have come up with but i keep getting compiler errors.
this is the example query i found:
INSERT INTO [Perm_Table] (theField1, theField2, theField3)
SELECT [Import_Table].field1, [Import_Table].field2, [Import_Table].field3
FROM [Import_Table] WHERE [Import_Table].[Uniqe_V #] NOT IN
(SELECT [Perm_Table].[Uniqe_V #] FROM [Perm_Table]);
and this is what i have.
INSERT INTO tbl_All_WIGIs (Emp_ID, Emp_Name, Posn_desc, WGI_Due_Dt, Original_WGI_Due_Dt, Date_LEI, WGI_Status, Pay_Plan, Grade, Step)
SELECT tbl_WIGI_TEST.Emp_ID, tbl_WIGI_TEST.Emp_Name, tbl_WIGI_TEST.Posn_desc, tbl_WIGI_TEST.WGI_Due_Dt, tbl_WIGI_TEST.Original_WGI_Due_Dt, tbl_WIGI_TEST.Date_LEI, tbl_WIGI_TEST.WGI_Status, tbl_WIGI_TEST.Pay_Plan, tbl_WIGI_TEST.Grade, tbl_WIGI_TEST.Step)
FROM tbl_WIGI_TEST where tbl_WIGI_TEST.Emp_ID not in
(Select tbl_All_WIGIs.[Emp_ID] from tbl_all_WIGIs);
since i am appending all the columns can i just do it like this:
INSERT INTO tbl_All_WIGIs.*
SELECT tbl_WIGI_TEST.*
FROM tbl_WIGI_TEST where tbl_WIGI_TEST.Emp_ID not in
(Select tbl_All_WIGIs.[Emp_ID] from tbl_all_WIGIs);
any help would be appriciated.