Data Comparision

I have a following problem.
i opened two connections conn and conn1 so i opened 2 tables from different 2 databases.
but both tables have the joining fileds employee_id and date1.
but i want to fetch only those records which are not same in both tables.

            Table1(Conn)                                  Table2(Conn1)
Employee_id            Date1                     Employee_id            Date1
    13265              11/09/2004               13265              11/09/2004
    13526              11/10/2004               13265              11/09/2004  
    13589              11/11/2004

So i want compare two different databases tables and extract only employeee_id 13589 or "nth employee_ids."
and result in flexgrid.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You dont have to create two seperate connection for this situation. Create a single recordset having left join from table1 to table2 and filter this so that only records that exist in table one and not in table2 appears.
create your recordset like:

SELECT * FROM Table1 LEFT JOIN Table2 ON (Table1.Employee_id= Table2.Employee_id) AND (Table1.Date1= Table2.Date1) Where Table2.Employee_id Is Null

havent tested code above but this should work. hope this helps:)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
azharmateenAuthor Commented:
But i must  need two different connections.
Then create your two connection if you really need it. then have a seperate one for the recordset above. update the recordset above everytime theres a change in the first two for you to see the changes.:)
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

I would say that prior to the comment given by Noel, I think you should give this statement

sql = "select * into tbl2 from table2 in '" & path of the second database goes here & "'

This will put both the tables in the same database.

Then u can run the distinct query statement given by Noel
U can give the points to Noel_castillo, as that is a right procedure
I think we both gave the solution for this question. Because i havent noticed that its from 2 different databases. Thus the points should be splited. :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.