UN-Match Query

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I have two tables with a like field in each table. Tables "A" and "B"
have a like field (Field#2). But Table "A" also has a field(Field#1)
which can contain a like value that is in Field#2.

I am trying to summarize Table "A" where Field#2 in Table "B" never
occurs in Field#1 in Table "A".

In the past I normally use the same method as the UnMatch Query Wizard
where I establish a left join between TableA(Field#1) and
TableB(Field#2) using a Where condition for TableB(Field#2) (Is Null).

I was trying to check the results by testing one record. So I queried
Table "A" for value "123ABC" by using the condition <> "123ABC" for
Field#1 and ="123ABC" for Table "A" Field#2.

The results are that by using the "Left-Join" method, I have a answer
set with fewer results than I do with my test query that doesn't use
the join. Why am I getting different answers?

I would appreciate any suggestions. Thanks.
 
The results are that by using the "Left-Join" method, I have a answer
set with fewer results than I do with my test query that doesn't use
the join. Why am I getting different answers?

Perhaps because of some error in the query. Care to post the SQL?

John W. Vinson[MVP]
 
John said:
Perhaps because of some error in the query. Care to post the SQL?

John W. Vinson[MVP]
John:

Here is the SQL for the query:

SELECT [T061 Step1].PCP_parent, [T061 Step1].pcpcod, [T061
Step1].PCPname, Sum([T061 Step1].SumOftopamt) AS SumOftopamt, [T061
Step1].PCP_spccod INTO [T062 Step2]
FROM [T061 Step1] LEFT JOIN [T003 PCP Data] ON [T061 Step1].provno =
[T003 PCP Data].pcpcod
WHERE ((([T003 PCP Data].pcpcod) Is Null))
GROUP BY [T061 Step1].PCP_parent, [T061 Step1].pcpcod, [T061
Step1].PCPname, [T061 Step1].PCP_spccod;
 
Back
Top