Create a single-record append query without warnings on duplicates
- From: HH <harm.horstman@xxxxxxxx>
- Date: Tue, 29 Apr 2008 03:25:19 -0700 (PDT)
To append a single record, without getting a warning if a record
already exists, I found out the following syntax works fine as Query
in MS Access:
first create a simple 'products' table...
CREATE TABLE products (code TEXT(10), description TEXT(100));
then try this...
INSERT INTO products (code, description)
SELECT code, description FROM (SELECT Count(*) AS X, 'ABC' AS code,
'Product ABC' AS description FROM properties) as sub
WHERE code NOT IN (SELECT code FROM products WHERE code = sub.code);
Somebody having a better solution for this?
.
- Follow-Ups:
- Prev by Date: Re: How to create a form based on a crosstab query? (I don't know how many columns there will be!)
- Next by Date: Re: How to create a form based on a crosstab query? (I don't know how many columns there will be!)
- Previous by thread: How to create a form based on a crosstab query? (I don't know how many columns there will be!)
- Next by thread: Re: Create a single-record append query without warnings on duplicates
- Index(es):
Relevant Pages
|