Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / March 2005

Tip: Looking for answers? Try searching our database.

Compare 2 tables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ethoemmes@blueyonder.co.uk - 08 Mar 2005 16:26 GMT
I have 2 tables (tblSAPDetails & tblVendorDetails) they both have
Vendor as the PK. I would like to run a query which would highligh the
differences between the 2 tables on 2 fields (ABC and Industry)

Eg:

TblSAPDetails:
Vendor    ABC   Industry
1004010   A     MK

TblVendorDetails:
Vendor    ABC   Industry
1004010   B     MK

Should somehow return the difference between the 2 tables.

Can anyone point me in the right direction?

TIA
Keith - 08 Mar 2005 16:32 GMT
> I have 2 tables (tblSAPDetails & tblVendorDetails) they both have
> Vendor as the PK. I would like to run a query which would highligh the
[quoted text clipped - 11 lines]
>
> Should somehow return the difference between the 2 tables.

Try concatonating the 3 fields for TblSAPDetails in one query and
concatonating the fields for TblVendorDetails in another.  If I'm
understanding you correctly, you could then include them in a third query
with an outer join on the concatonated fields and test for nulls.

Regards,
Keith.
www.keithwilby.com
Alan Webb - 08 Mar 2005 17:36 GMT
Keith,
Why not do a calculated join on the two columns, for example:
SELECT VENDOR_OLD.NAME AS OLD_VENDOR_NAME, VENDOR_NEW.NAME AS
NEW_VENDOR_NAME
FROM tblSAPDetails as VENDOR_OLD, tblVendorDetails AS VENDOR_NEW
WHERE VENDOR_OLD.ABC <> VENDOR_NEW.ABC
AND VENDOR_OLD.INDUSTRY <> VENDOR_NEW.INDUSTRY

This will give you anything that does not have a matching ABC and Industry.

>> I have 2 tables (tblSAPDetails & tblVendorDetails) they both have
>> Vendor as the PK. I would like to run a query which would highligh the
[quoted text clipped - 20 lines]
> Keith.
> www.keithwilby.com 
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.