Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing 2 tables and showing the results 2

Status
Not open for further replies.

miller1975

Programmer
Apr 19, 2005
58
US
Hello All,
I am attempting to do the following.
I have 2 tables, I am going to call it Tbl_Old (has old data) and Tbl_New (has new data).
Both the tables have same field names and structure. I need to compare these 2 tables and show the difference in a new table, which I will call Tbl_Result.

Any ideas on how to do this. Maybe a query to find the difference.
Also I want to know how to move data from one table to another. Again both tables have same field structure.
Please advice.
 
But it saves it as a Cross Tab query
Really ?
BTW, you still doesn't answer my throbbing question:
Which field(s) identify a record in tbl_old without ambiguity vs the another records in tbl_old
OR (same question phrased differently):
How do you differentiate records in tbl_old

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,


The "old" and "new" tables are created as the output of another query (see thread701-1047689).

Not sure still of what can be a unique key on the output table, which means that it may need to be the whole record.

The whole process miller1975 is trying to implement is

1-Weekly run the query mentioned and update "current" week table.

2-Then compare this data against the last week information and retrieve all new records.

3-Output should go to an Excel file (this will need to be done by code)
The number of times the Excel file is to be created for the same data should determine whether this particular "select" should output to a table instead, meaning that the Excel code would then just select all queries from this new table instead of issueing the SQL directly.

Some Access guys have a very bad habit of creating "make table" queries and running this from a macro where they first set it to ignore all errors, e.g. where the table already exists.





Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top