Forum Discussion
Update Query - 3 criteria
- Feb 06, 2025
Running the Select query on only the Copy table does not prove that the main table also has records with same values in the join fields.
Rather make a copy of the Update query, and switch to Select query.
Running the Select query on only the Copy table does not prove that the main table also has records with same values in the join fields.
Rather make a copy of the Update query, and switch to Select query.
I have now figured it out. The update To criteria needs to be on the table you are grabbing the data FrOM but the update CRTERIA needs to be on the target table (as I initially thought but I was putting the update criteria on the other table. Little difficult to explain. All in all I had 3 colyumns but needed 6. I have never liked update queries when joining tables.
this works:
UPDATE Import_ExcelPC INNER JOIN Import_ExcelPC_Copy ON (Import_ExcelPC.[Invoice amount] = Import_ExcelPC_Copy.[Invoice amount]) AND (Import_ExcelPC.[Invoice No Stripped] = Import_ExcelPC_Copy.[Invoice No Stripped])
SET Import_ExcelPC.Notes = [Import_ExcelPC_Copy].[Notes], Import_ExcelPC.OKToPayYN = [Import_ExcelPC_Copy].[OKToPayYN], Import_ExcelPC.DABYN = [Import_ExcelPC_Copy].[DABYN]
WHERE (((Import_ExcelPC_Copy.Notes) Is Not Null)) OR (((Import_ExcelPC_Copy.OKToPayYN)<>0)) OR (((Import_ExcelPC_Copy.DABYN)<>0));