Hello,
I used the query builder to build an unmatched query and everything worked out good. It was to look on my update table, find all the new employee's and add them to my master table. I need a similar query to update my main table but i need to update the WGI field on my master table of anyone that has a WGI date that is different than what is in the Update table.
This is the SQL for the first query i made using the wizard:
SELECT tbl_WIGI_Updates.Emp_ID, tbl_WIGI_Updates.Emp_Name, tbl_WIGI_Updates.Old_Name, tbl_WIGI_Updates.Posn_Desc, tbl_WIGI_Updates.Occ_Series, tbl_WIGI_Updates.WGI_Due_Dt, tbl_WIGI_Updates.Original_WGI_Due_Dt, tbl_WIGI_Updates.Date_LEI, tbl_WIGI_Updates.WGI_Status, tbl_WIGI_Updates.Pay_Plan, tbl_WIGI_Updates.Grade, tbl_WIGI_Updates.Step, tbl_WIGI_Updates.Annual_Rt, tbl_WIGI_Updates.Dept_ID, tbl_WIGI_Updates.Short_Desc, tbl_WIGI_Updates.AO_Code, tbl_WIGI_Updates.WIGI_Approval_Status, tbl_WIGI_Updates.Notes
FROM tbl_WIGI_Updates LEFT JOIN tbl_All_WIGIs ON tbl_WIGI_Updates.[Emp_ID] = tbl_All_WIGIs.[Emp_ID]
WHERE (((tbl_All_WIGIs.Emp_ID) Is Null));
I copied and pasted the code and added the section that is in green txt
SELECT tbl_WIGI_Updates.Emp_ID, tbl_WIGI_Updates.Emp_Name, tbl_WIGI_Updates.Old_Name, tbl_WIGI_Updates.Posn_Desc, tbl_WIGI_Updates.Occ_Series, tbl_WIGI_Updates.WGI_Due_Dt, tbl_WIGI_Updates.Original_WGI_Due_Dt, tbl_WIGI_Updates.Date_LEI, tbl_WIGI_Updates.WGI_Status, tbl_WIGI_Updates.Pay_Plan, tbl_WIGI_Updates.Grade, tbl_WIGI_Updates.Step, tbl_WIGI_Updates.Annual_Rt, tbl_WIGI_Updates.Dept_ID, tbl_WIGI_Updates.Short_Desc, tbl_WIGI_Updates.AO_Code, tbl_WIGI_Updates.WIGI_Approval_Status, tbl_WIGI_Updates.Notes
FROM tbl_WIGI_Updates LEFT JOIN tbl_All_WIGIs ON tbl_WIGI_Updates.[Emp_ID] = tbl_All_WIGIs.[Emp_ID] and tbl_WIGI_Updates.[WGI_Due_Dt] <> tbl_All_WIGIs.[WGI_Due_Dt]
WHERE (((tbl_All_WIGIs.Emp_ID) Is Null));
I dont really know anything about SQL, could someone please explain what is going on or what i need to do to fix it? The qurey will pull data, it just only pulls the test cases i have used to add as new employees and no other records. Not sure what other info you would need..