JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
I'm trying to write a query that will add a value to a table in Access if the value does not already exist.
Table is: tbl_Client which only contains fields Client_ID and Client_Name
From online reading, I've written in Access query:
However, this errors with: "Invalid SQL statement; expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE"
Can someone help correct syntax please?
TIA,
Jack
I'm trying to write a query that will add a value to a table in Access if the value does not already exist.
Table is: tbl_Client which only contains fields Client_ID and Client_Name
From online reading, I've written in Access query:
Code:
IF NOT EXISTS(SELECT * FROM tbl_Client WHERE Client_Name = 'test')
INSERT Values('test') INTO tbl_Client.Client_Name
However, this errors with: "Invalid SQL statement; expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE"
Can someone help correct syntax please?
TIA,
Jack