change query to insert into

sven2

Registered User.
Local time
Today, 16:58
Joined
Apr 28, 2007
Messages
297
Hello,

below I have a query that returns all itemnummers that have to be inserted into the table personeels_evaluaties.

SELECT dbo.Functiewaardering_Stam.Itemnummer
FROM dbo.Functiewaardering_Stam LEFT OUTER JOIN
dbo.Personeels_evaluaties ON dbo.Functiewaardering_Stam.Itemnummer = dbo.Personeels_evaluaties.Itemnummer
WHERE (dbo.Functiewaardering_Stam.FunctieID = 3) AND (dbo.Functiewaardering_Stam.MachineID = 3) AND (dbo.Functiewaardering_Stam.GraadID = 2) AND
(NOT (dbo.Functiewaardering_Stam.Itemnummer IN
(SELECT Personeels_evaluaties.Itemnummer
FROM dbo.Personeels_evaluaties
WHERE (Personeelsnummer = 169))))


How can I insert the result of this query in combination with personeelnummer?

For Example: the result of the query for personeelnummmer 169 =
5
7
10
11

In the table personeel_evaluaties should be inserted

itemnummer personeelsnummer
5 169
7 169
10 169
11 169




How can I do this?

Thanks in advance,
Sven.
 
With the Query in view using the Query Builder (Design View), in Toolbar click "Query", "Append Query". You will be prompted for the TableName to append to. Select and click [OK]. You will see the Query format changes. For each field in the fieldlist, in the "Update To" row, select the appropriate field name in the target table. You haven't stated what your DataTypes are or your target table design, but you will will not be able to insert a field value if the target field is an Auto-Number Primary Key.
 

Users who are viewing this thread

Back
Top Bottom