A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

howto copy only newer OrderID data(and the other fields) from onetable to another table



 
 
Thread Tools Display Modes
  #1  
Old March 1st, 2010, 04:36 PM posted to microsoft.public.access.queries
Bartus[_2_]
external usenet poster
 
Posts: 1
Default 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  
Old March 1st, 2010, 05:19 PM posted to microsoft.public.access.queries
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default 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  
Old March 1st, 2010, 05:27 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default 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  
Old March 3rd, 2010, 11:14 AM posted to microsoft.public.access.queries
Bart[_4_]
external usenet poster
 
Posts: 8
Default 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  
Old March 3rd, 2010, 03:29 PM posted to microsoft.public.access.queries
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default 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  
Old March 5th, 2010, 02:35 PM posted to microsoft.public.access.queries
Bart[_4_]
external usenet poster
 
Posts: 8
Default 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  
Old March 6th, 2010, 12:05 PM posted to microsoft.public.access.queries
Bart[_4_]
external usenet poster
 
Posts: 8
Default 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  
Old March 7th, 2010, 07:44 AM posted to microsoft.public.access.queries
Bart[_4_]
external usenet poster
 
Posts: 8
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.