Hi,
I have two tables, table1 keeps track of all history, table2 can be changed. I want to design a query so that I can append info. from table2 into table1 only if the record or row is entirely different.
For example: Table1 contains
ID Name DateTime Status $
1 A 1/1/05 1:00 Paid 10
2 B 1/3/05 1:00 Pending 20
3 B 1/3/05 3:00 Paid 20
4 C 1/5/05 4:00 Pending 10
Table2 contains
Name DateTime Status $
A 1/1/05 1:00 Paid 10
B 1/3/05 3:00 Paid 20
C 1/5/05 5:00 Paid 10
D 1/6/05 1:00 Pending 5
After the query, table1 should look
ID Name DateTime Status $
1 A 1/1/05 1:00 Paid 10
2 B 1/3/05 1:00 Pending 20
3 B 1/3/05 3:00 Paid 20
4 C 1/5/05 4:00 Pending 10
5 C 1/5/05 5:00 Paid 10
6 D 1/6/05 1:00 Pending 5
I don't want to use the update Query because I want to retain the historical data. I need the table2 to look like this because I can pull it up and only see the most recent data for each individual. To accomplish this, I made [Name] in the table2 the primary key and run a query to append data from table1 to table2.
Please help if you know how to append only different data. Or please let me know a simple way to do this.
Thanks.
Kris
I have two tables, table1 keeps track of all history, table2 can be changed. I want to design a query so that I can append info. from table2 into table1 only if the record or row is entirely different.
For example: Table1 contains
ID Name DateTime Status $
1 A 1/1/05 1:00 Paid 10
2 B 1/3/05 1:00 Pending 20
3 B 1/3/05 3:00 Paid 20
4 C 1/5/05 4:00 Pending 10
Table2 contains
Name DateTime Status $
A 1/1/05 1:00 Paid 10
B 1/3/05 3:00 Paid 20
C 1/5/05 5:00 Paid 10
D 1/6/05 1:00 Pending 5
After the query, table1 should look
ID Name DateTime Status $
1 A 1/1/05 1:00 Paid 10
2 B 1/3/05 1:00 Pending 20
3 B 1/3/05 3:00 Paid 20
4 C 1/5/05 4:00 Pending 10
5 C 1/5/05 5:00 Paid 10
6 D 1/6/05 1:00 Pending 5
I don't want to use the update Query because I want to retain the historical data. I need the table2 to look like this because I can pull it up and only see the most recent data for each individual. To accomplish this, I made [Name] in the table2 the primary key and run a query to append data from table1 to table2.
Please help if you know how to append only different data. Or please let me know a simple way to do this.
Thanks.
Kris