KevEarthwatch
Technical User
I am writing a query which will find unmatched records between two tables, and append the unmatched entries to oneof the tables. One table is a linked excel sheet, the other is a local copy of that same table. The query is intended to make sure that the local table copy always contains the same information as the linked excel sheet (which contains a link to an external data source, and is always adding records, which I want to be accounted for in my DB).
The SQL i have written is below (i have other queries, for other tables with different field names written the exact same way which work fine).
However, i am prompted with "Syntax Errors in INSERT INTO statement" when i try to save the query. I cannot figure out why.
Please keep answers rather simple, I am new to access and SQL.
Thanks for your help!
SQL:
INSERT INTO [Copy Team and Forms] (IDNUMBER, [SIGNUP STATUS], [LEAD PI], [TEAM START DATE], [SUB AFFILIATE], [MARKETING TITLE], [BRIEFING AVAIL], [TEAM END DATE], [ACCEPT DATE], [ALL DOCS RECEIVED], [BRIEFING SENT DATE], evaluation_required, [FELLOWSHIP REPORT], [OFFER SENT DATE], [TEAM NUMBER], [TSHIRT SIZE], [WELCOME BACK SENT DATE], note)
SELECT [Copy Team and Forms].IDNUMBER, [Copy Team and Forms].[SIGNUP STATUS], [Copy Team and Forms].[LEAD PI], [Copy Team and Forms].[TEAM START DATE], [Copy Team and Forms].[SUB AFFILIATE], [Copy Team and Forms].[MARKETING TITLE], [Copy Team and Forms].[BRIEFING AVAIL], [Copy Team and Forms].[TEAM END DATE], [Copy Team and Forms].[ACCEPT DATE], [Copy Team and Forms].[ALL DOCS RECEIVED], [Copy Team and Forms].[BRIEFING SENT DATE], [Copy Team and Forms].evaluation_required, [Copy Team and Forms].[FELLOWSHIP REPORT], [Copy Team and Forms].[OFFER SENT DATE], [Copy Team and Forms].[TEAM NUMBER], [Copy Team and Forms].[TSHIRT SIZE], [Copy Team and Forms].[WELCOME BACK SENT DATE], [Copy Team and Forms].note
FROM [Copy Team and Forms] LEFT JOIN [Team and Forms] ON [Copy Team and Forms].IDNUMBER = [Team and Forms].IDNUMBER
WHERE ((([Team and Forms].IDNUMBER) Is Null));
The SQL i have written is below (i have other queries, for other tables with different field names written the exact same way which work fine).
However, i am prompted with "Syntax Errors in INSERT INTO statement" when i try to save the query. I cannot figure out why.
Please keep answers rather simple, I am new to access and SQL.
Thanks for your help!
SQL:
INSERT INTO [Copy Team and Forms] (IDNUMBER, [SIGNUP STATUS], [LEAD PI], [TEAM START DATE], [SUB AFFILIATE], [MARKETING TITLE], [BRIEFING AVAIL], [TEAM END DATE], [ACCEPT DATE], [ALL DOCS RECEIVED], [BRIEFING SENT DATE], evaluation_required, [FELLOWSHIP REPORT], [OFFER SENT DATE], [TEAM NUMBER], [TSHIRT SIZE], [WELCOME BACK SENT DATE], note)
SELECT [Copy Team and Forms].IDNUMBER, [Copy Team and Forms].[SIGNUP STATUS], [Copy Team and Forms].[LEAD PI], [Copy Team and Forms].[TEAM START DATE], [Copy Team and Forms].[SUB AFFILIATE], [Copy Team and Forms].[MARKETING TITLE], [Copy Team and Forms].[BRIEFING AVAIL], [Copy Team and Forms].[TEAM END DATE], [Copy Team and Forms].[ACCEPT DATE], [Copy Team and Forms].[ALL DOCS RECEIVED], [Copy Team and Forms].[BRIEFING SENT DATE], [Copy Team and Forms].evaluation_required, [Copy Team and Forms].[FELLOWSHIP REPORT], [Copy Team and Forms].[OFFER SENT DATE], [Copy Team and Forms].[TEAM NUMBER], [Copy Team and Forms].[TSHIRT SIZE], [Copy Team and Forms].[WELCOME BACK SENT DATE], [Copy Team and Forms].note
FROM [Copy Team and Forms] LEFT JOIN [Team and Forms] ON [Copy Team and Forms].IDNUMBER = [Team and Forms].IDNUMBER
WHERE ((([Team and Forms].IDNUMBER) Is Null));