If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
howto copy only newer OrderID data(and the other fields) from onetable to another table
howto copy only newer OrderID data(and the other fields) from one
table to another table So the new table is updated only with the new OrderID and the OrderID's already copyied earlier are not also added everytime. i use the append query i think and need certainly some criteria (filters)? Can somebody help me out, please? Thank you! Bart |
#2
|
|||
|
|||
howto copy only newer OrderID data(and the other fields) from one
Bartus -
The criteria you need (assuming OrderID is the key field) will be something like this (use your table names): = Not Exists (SELECT 'X' from [newTableName] where [newTableName].OrderID = [oldTableName].OrderID) If you still have problems, post your SQL so we can help more. -- Daryl S "Bartus" wrote: howto copy only newer OrderID data(and the other fields) from one table to another table So the new table is updated only with the new OrderID and the OrderID's already copyied earlier are not also added everytime. i use the append query i think and need certainly some criteria (filters)? Can somebody help me out, please? Thank you! Bart . |
#3
|
|||
|
|||
howto copy only newer OrderID data(and the other fields) from one table to another table
Bartus wrote:
howto copy only newer OrderID data(and the other fields) from one table to another table So the new table is updated only with the new OrderID and the OrderID's already copyied earlier are not also added everytime. i use the append query i think and need certainly some criteria (filters)? INSERT INTO table2 (OrderID, f1, f2, ...) SELECT OrderID, f1, f2, ... FROM table1 INNER JOIN table2 ON table1.key = table2.key WHERE tabl2.key Is Null -- Marsh MVP [MS Access] |
#4
|
|||
|
|||
howto copy only newer OrderID data(and the other fields) from onetable to another table
On 1 mrt, 18:27, Marshall Barton wrote:
Bartus wrote: howto copy only newer OrderID data(and the other fields) from one table to another table So the new table is updated only with the new OrderID and the OrderID's already copyied earlier are not also added everytime. i use the append query i think and need certainly some criteria (filters)? INSERT INTO table2 (OrderID, f1, f2, ...) SELECT OrderID, f1, f2, ... FROM table1 INNER JOIN table2 * * * * ON table1.key = table2.key WHERE tabl2.key Is Null -- Marsh MVP [MS Access] INSERT INTO Bestellingen_copy (BestellingID) SELECT BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy ON Bestellingen_1.BestellingID= Bestellingen_copy.BestellingID WHERE Bestellingen_copy.BestellingID Is Null I try your code and the system says BestellingID can point out more then one source.. THe source and destination tables have no key(-ID). Source table: Bestellingen_1 Dest. table: Bestellingen_copy Can you help me out? Thank you Bart |
#5
|
|||
|
|||
howto copy only newer OrderID data(and the other fields) from
Bart -
The tablename is needed on the SELECT line, like this: INSERT INTO Bestellingen_copy (BestellingID) SELECT Bestellingen_1.BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy ON Bestellingen_1.BestellingID= Bestellingen_copy.BestellingID WHERE Bestellingen_copy.BestellingID Is Null -- Daryl S "Bart" wrote: On 1 mrt, 18:27, Marshall Barton wrote: Bartus wrote: howto copy only newer OrderID data(and the other fields) from one table to another table So the new table is updated only with the new OrderID and the OrderID's already copyied earlier are not also added everytime. i use the append query i think and need certainly some criteria (filters)? INSERT INTO table2 (OrderID, f1, f2, ...) SELECT OrderID, f1, f2, ... FROM table1 INNER JOIN table2 ON table1.key = table2.key WHERE tabl2.key Is Null -- Marsh MVP [MS Access] INSERT INTO Bestellingen_copy (BestellingID) SELECT BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy ON Bestellingen_1.BestellingID= Bestellingen_copy.BestellingID WHERE Bestellingen_copy.BestellingID Is Null I try your code and the system says BestellingID can point out more then one source.. THe source and destination tables have no key(-ID). Source table: Bestellingen_1 Dest. table: Bestellingen_copy Can you help me out? Thank you Bart . |
#6
|
|||
|
|||
howto copy only newer OrderID data(and the other fields) from
On 3 mrt, 16:29, Daryl S wrote:
Bart - The tablename is needed on the SELECT line, like this: INSERT INTO Bestellingen_copy (BestellingID) SELECT Bestellingen_1.BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy * * * * ON Bestellingen_1.BestellingID= Bestellingen_copy.BestellingID WHERE Bestellingen_copy.BestellingID Is Null -- Daryl S "Bart" wrote: On 1 mrt, 18:27, Marshall Barton wrote: Bartus wrote: howto copy only newer OrderID data(and the other fields) from one table to another table So the new table is updated only with the new OrderID and the OrderID's already copyied earlier are not also added everytime. i use the append query i think and need certainly some criteria (filters)? INSERT INTO table2 (OrderID, f1, f2, ...) SELECT OrderID, f1, f2, ... FROM table1 INNER JOIN table2 * * * * ON table1.key = table2.key WHERE tabl2.key Is Null -- Marsh MVP [MS Access] INSERT INTO Bestellingen_copy (BestellingID) SELECT BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy * * * * ON Bestellingen_1.BestellingID= Bestellingen_copy.BestellingID WHERE Bestellingen_copy.BestellingID Is Null I try your code and the system says BestellingID can point out more then one source.. THe source and destination tables have no key(-ID). Source table: Bestellingen_1 Dest. table: Bestellingen_copy Can you help me out? Thank you Bart .- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - Thank you Daryl, why it doens't copy the data? Bart |
#7
|
|||
|
|||
howto copy only newer OrderID data(and the other fields) from
On 5 mrt, 15:35, Bart wrote:
On 3 mrt, 16:29, Daryl S wrote: Bart - The tablename is needed on the SELECT line, like this: INSERT INTO Bestellingen_copy (BestellingID) SELECT Bestellingen_1.BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy * * * * ON Bestellingen_1.BestellingID= Bestellingen_copy.BestellingID WHERE Bestellingen_copy.BestellingID Is Null -- Daryl S "Bart" wrote: On 1 mrt, 18:27, Marshall Barton wrote: Bartus wrote: howto copy only newer OrderID data(and the other fields) from one table to another table So the new table is updated only with the new OrderID and the OrderID's already copyied earlier are not also added everytime. i use the append query i think and need certainly some criteria (filters)? INSERT INTO table2 (OrderID, f1, f2, ...) SELECT OrderID, f1, f2, ... FROM table1 INNER JOIN table2 * * * * ON table1.key = table2.key WHERE tabl2.key Is Null -- Marsh MVP [MS Access] INSERT INTO Bestellingen_copy (BestellingID) SELECT BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy * * * * ON Bestellingen_1.BestellingID= Bestellingen_copy.BestellingID WHERE Bestellingen_copy.BestellingID Is Null I try your code and the system says BestellingID can point out more then one source.. THe source and destination tables have no key(-ID). Source table: Bestellingen_1 Dest. table: Bestellingen_copy Can you help me out? Thank you Bart .- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - Thank you Daryl, why it doens't copy the data? Bart- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - =not Exists (SELECT 'KlantID' from [Klant_copy] where [Klant_copy].KlantID = [Klant].KlantID) I try this also, but i does'nt transfer anything Bart |
#8
|
|||
|
|||
howto copy only newer OrderID data(and the other fields) from
On 6 mrt, 13:05, Bart wrote:
On 5 mrt, 15:35, Bart wrote: On 3 mrt, 16:29, Daryl S wrote: Bart - The tablename is needed on the SELECT line, like this: INSERT INTO Bestellingen_copy (BestellingID) SELECT Bestellingen_1.BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy * * * * ON Bestellingen_1.BestellingID= Bestellingen_copy.BestellingID WHERE Bestellingen_copy.BestellingID Is Null -- Daryl S "Bart" wrote: On 1 mrt, 18:27, Marshall Barton wrote: Bartus wrote: howto copy only newer OrderID data(and the other fields) from one table to another table So the new table is updated only with the new OrderID and the OrderID's already copyied earlier are not also added everytime. i use the append query i think and need certainly some criteria (filters)? INSERT INTO table2 (OrderID, f1, f2, ...) SELECT OrderID, f1, f2, ... FROM table1 INNER JOIN table2 * * * * ON table1.key = table2.key WHERE tabl2.key Is Null -- Marsh MVP [MS Access] INSERT INTO Bestellingen_copy (BestellingID) SELECT BestellingID FROM Bestellingen_1 INNER JOIN Bestellingen_copy * * * * ON Bestellingen_1.BestellingID= Bestellingen_copy..BestellingID WHERE Bestellingen_copy.BestellingID Is Null I try your code and the system says BestellingID can point out more then one source.. THe source and destination tables have no key(-ID). Source table: Bestellingen_1 Dest. table: Bestellingen_copy Can you help me out? Thank you Bart .- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - Thank you Daryl, why it doens't copy the data? Bart- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - =not Exists (SELECT 'KlantID' from [Klant_copy] where [Klant_copy].KlantID = [Klant].KlantID) I try this also, but i does'nt transfer anything Bart- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - i found it! SELECT Klant.KlantID, Klant.Instellingsnaam, Klant.Naam, Klant.Voornaam, Klant.EmailAdres, Klant.Directe_telefoon, Klant.KlantRootID, Klant.Memo, Klant.SoortKlant, Klant.Straatnaam_nr, Klant.Gemeente, Klant.Postcode, Klant.Passwoord FROM Klant LEFT JOIN Klant_copy ON Klant.KlantID = Klant_copy.KlantID WHERE (((Klant_copy.KlantID) Is Null)); INSERT INTO Klant_copy SELECT Query98.* FROM Query98; |
Thread Tools | |
Display Modes | |
|
|