0

I have two tables of employee information from two different sources, one from Active Directory and one from our Billing Department.

The AD table has the following columns:
EmployeeID
Surname
Givenname
Company
Office.

The Billing Dept table thas the following columns:
EmployeeID
Company
Office
First
Last.

I want to compare the elements in each table and generate a table with the differences from both. Thanks for the help in advance.

3
Contributors
4
Replies
5
Views
4 Years
Discussion Span
Last Post by mrkm1188
0

Let me rephrase. I want one table as a result that contains the rows from each table that should be the same but have a field that is different
For example: If there are two rows that have the same employee ID but different names, then i want the row from the first table followed by the row from the second table so i can see the differences.

1
select ad.EmployeeID,
ad.Surname,
ad.Givenname,
ad.Company,
ad.Office ,

BD.EmployeeID,
bd.Company,
bd.Office,
bd.First,
bd.Last
from ad inner join bd on ad.employeeid =bd.employeeid
where (ad.surname<>bd.last or ad.givenname<>bd.first or ad.company<>bd.company or ad.office<>bd.office)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.