Create a single-record append query without warnings on duplicates



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?
.



Relevant Pages

  • Single-record append query without warnings on duplicates
    ... To append a single record, without getting a warning when a record ... I found out the following syntax works fine as Query ... 'Product ABC' AS description FROM properties) as sub ...
    (microsoft.public.access.queries)
  • Re: Single-record append query without warnings on duplicates
    ... I found out the following syntax works fine as Query ... 'Product ABC' AS description FROM properties) as sub ... MVP ...
    (microsoft.public.access.queries)
  • Re: Word Doc connected to Access Query
    ... I had not thought about many of your scenarios Peter, ... a single record it will show its content. ... in disconnecting the data source before saving. ... query that selects a single record? ...
    (microsoft.public.word.mailmerge.fields)
  • Re: String manipulation
    ... So long as you'd need the WHERE clause to differentiate when a field should ... that you have cited will not lend itself to a single query. ... single record may not all meet the same WHERE constraint. ... Those queries won't just mean running ...
    (microsoft.public.access.queries)
  • RE: read sql record into memory, use/modify fields then save changes
    ... As for the data query & updating scenario you mentioned, ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ... How is the best way to return a single record via sql query that will ...
    (microsoft.public.dotnet.languages.vb)