0

I searched this website and google for 3-4 hours to see how can I insert two fields of data from one table(such as table1) to another(tests), if one specific data from a column in tests table is chosen by user, then other data from table1 appear on the next column in the tests table. I used some codes, such as:

INSERT INTO Tests SELECT * FROM Table1 WHERE PRIMARY_KEY NOT IN 
(SELECT PRIMARY_KEY FROM Tests) 

(from here:Update data from one table to another and insert if new ms access .net)

INSERT INTO Tests(TestMethod, AcceptanceCriteria)
SELECT TestMethod, AcceptanceCriteria 
FROM Table1 
GROUP BY TestMethod;

(from here: How to do INSERT into a table records extracted from another table)

INSERT INTO Tests ( AcceptanceCriteria1 )
SELECT Table1.AcceptanceCriteria
FROM Table1
WHERE (((Table1.TestMethod) Like ([Tests].[TestMethod] & '*')));

(From here: http://www.tek-tips.com/viewthread.cfm?qid=1528492)

But None of them work.

Community
  • 1
  • 1
bsh
  • 161
  • 1
  • 5
  • I don't understand. What exactly do you mean by "is chosen by user"? -- Please give a sample of `Table1`, and what you expect to end up in `Test`. – Andre Sep 19 '16 at 11:20

1 Answers1

-1

INSERT INTO TABLE2(A,B,C) SELECT A,B,C FROM TABLE1 WHERE C = 1 // here put you condition for specific column -- e.g

Ammar Mousa
  • 48
  • 10