Compare to tables and add recordsmissing in main table

  • Thread starter Thread starter RoBo
  • Start date Start date
R

RoBo

Who an give me a hand with this?

I would like to compare two tables joined by the key value. If a key is
present in the leading table but missing in the subordinate table, it should
be added to that table. Should I use an ADD query and how should I specify
the criteria?

Thanks for your help.

Ron
 
To clear up my question:

This is the SQL code of the query:
INSERT INTO TBL_Strategieën ( [stg_CFT code], stg_Corporatie,
stg_Financieel, stg_Technisch )
SELECT TBL_Strategieën.[stg_CFT code], TBL_Strategieën.stg_Corporatie,
TBL_Strategieën.stg_Financieel, TBL_Strategieën.stg_Technisch
FROM TBL_Strategieën RIGHT JOIN [TRQRY_Complexen in TBL_Woningen] ON
TBL_Strategieën.[stg_CFT code] = [TRQRY_Complexen in TBL_Woningen].[wng_CFT
CODE]
WHERE ((([TRQRY_Complexen in TBL_Woningen].[wng_CFT CODE]) Is Not Null));

What should I add/change to add the new records that are in the table
TBL_Woningen but are missing/not present in the table TBL_Strategieën?

Hope this will help answer the question.

Ron
 
Back
Top