Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Data Comparision

Posted on 2004-11-10
Medium Priority
Last Modified: 2010-05-02
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.

Question by:azharmateen
  • 3
  • 2

Accepted Solution

Noel_Castillo earned 252 total points
ID: 12553066
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:)

Author Comment

ID: 12553262
But i must  need two different connections.

Expert Comment

ID: 12561917
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.:)
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Assisted Solution

kishore3576 earned 248 total points
ID: 12572321
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

Expert Comment

ID: 12816177
U can give the points to Noel_castillo, as that is a right procedure

Expert Comment

ID: 12826082
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. :)

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question