Wrong data from query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query as shown below that is getting the wrong match. The Lead ID
from Combine (which is a query itself) is getting a wrong match from the Lead
ID from Join LeadSP (which is a table). And the wrong answer is consistent,
so that if Combine.[Lead ID] is a 3 then [Join LeadSP].[Lead ID] is always a
14....except it's supposed to be a 3. I've seen this happen before and I
don't understand why it's happening. So what am I doing wrong? HELP!!

SELECT Combine.KPA, Combine.[Lead ID], [Join LeadSP].[Lead ID], [Join
LeadSP].[SP ID]
FROM Combine LEFT JOIN [Join LeadSP] ON Combine.[Lead ID] = [Join
LeadSP].[Lead ID];
 
As this query is based on another query, it would help to see that one also.

Also if any of the tables involved are using lookups or subdata sheets, they
could be causing a problem between what is actually in the table and what you
see.

Your best bet may be to manually track the problem data through all the
tables and queries to see why it is not showing as you expect.

Are all your joined in the relationship window with referiental integrity
enabled? If not you might have a data problem like near duplicate records or
a cartisian join.

Other than that there is a very slight possibility that the database is
corrupt; however, this doesn't seem like a corruption issue.
 
Back
Top