PDA

View Full Version : Compare two tables



nedy_03
03-12-2007, 06:29 AM
Hello,

I have two tables : "Operator" and "Supervisor" with an identical sructure. I would need a query that compares the rows from the two tables, and if they are identical the test is "ok" otherwise the test is "not ok". At the and this query should give the number of the "test ok" and "test not ok" ...

Could u please help me on this? ... u can see the db in attach if necessary ...

Thx,
Nedy

OBP
03-12-2007, 08:10 AM
nedy, you should be able to do the "Not ok" by using a simple "Unmatched Query".
This can be set up using the "Unmatched Query Wizard" from the Query Main Menu "New" menu item.
I think to get both results you would need to use 3 queries, one to count each type (matching/not matching) and then one to bring them together.

stanl
03-12-2007, 10:55 AM
depending upon your familiarity with SQL, a UNION query would probably work. Either way, this should be of some help

http://office.microsoft.com/en-us/access/HA102051321033.aspx

Stan

mattj
06-01-2007, 06:29 AM
Your tables are not normalized - you should have a single table with a field that indicates whether the record is for a operator or supervisor.

HTH
Matt