Insert Name record into TABLE2 if TABLE1 field is Yes.

  • Thread starter Thread starter Joe M
  • Start date Start date
J

Joe M

If I have two tables, and each table has a field called "NAMES" , eg. Name
of product . What I want to do is to insert the NAME record from Table1 into
Table2 whenever the HAVE field in table1 is "Yes".
So if TABLE1 - 'HAVE' field is "Yes" . Insert this record into TABLE2
also. What's the best way to do this??? Thanks
 
sound like an append query.
INSERT INTO Table2 (name, otherfield, anotherfield, ect)
select name, otherfield, anotherfield, ect
FROM table1
WHERE have = "Yes";
 
You would almost certainly be better off using a query to
filter records baswed on HAVE being Yes (or No). This is
better database design than storing data redundantly. One
of the problems with redundant data is that two separate
records need to be modified if a change is ever
necessary. The whole point of a relational database is to
relate records to each other, not to copy them from one
place to another.
 
Back
Top