Append to same table

  • Thread starter Thread starter Klaas
  • Start date Start date
K

Klaas

My table Films has a related table Details which has a field Category, so I
can specify more than one category for a film (like western, comedy,
history). The FilmID field is available in the Details table. Now I want to
add a new category "nonfiction" for all films in the categories newsreel,
documentary, and science. It is an Append query, but I cannot figure out
how it works. It probably involves appending to the same table. Any
suggestions? Your help is appreciated greatly!

Klaas
 
Try something along the following lines

INSERT INTO Details ( filmId, category )
SELECT DISTINCT filmId, "Non-Fiction" AS newCategory
FROM Details
WHERE category IN ("Newsreel" ,"Documentary" , "Science" );

This is untested air-code.

Hope This Helps
Gerald Stanley MCSD
 
Thanks Gerald, it works like sunshine in springtime.

Klaas


Gerald Stanley wrote in microsoft.public.access.queries:
 
Back
Top