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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference of two tables

Status
Not open for further replies.

vbLew

Programmer
Feb 28, 2005
22
US
Hello SQL Gurus,

I am having trouble writing a SQL Query to find different records between two tables that are exactly the same structure.

I have one table called tblRequirements,and another table, I download from another system, called tblTempRequirements.

I want to create a query that would subtract tblTempRequirements from tblRequirements in order to see which records are have been added or deleted from tblRequirements.

The problem is there is no one field that defines the primary key, It's a combination of many fields.

Thanks,



 
Hi,

There may be some SQL gurus here, but no clarvoyants, as far as I know.

Skip,
[sub]
[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blown-apart! [tongue][/sub]

 
Join the two tables on the key. I seem to recall you can involve a maxiumim of 16 fields in a join in Jet. You can then detect new or deleted fields by selecting records that have a null in one of the target join fields. Access only does one-way outer joins (left/right) so you will need to run several queries to get the various possible scenarios.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top