Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append Unmatched Query - Why Recieve Syntax Error? 1

Status
Not open for further replies.

KevEarthwatch

Technical User
Apr 23, 2009
6
US
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));
 
It might be because NOTE is a reserved word in Access.

Hope this helps

HarleyQuinn
---------------------------------
You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
good call!

changing note to [note] worked like a charm! Thanks a bunch for the fast reply!
 
Glad I could help [smile]

HarleyQuinn
---------------------------------
You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top