Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross Check Two Tables

Status
Not open for further replies.

t5amec

Programmer
Aug 14, 2003
112
GB
I have two tables "Tbl2a" and "Tbl2b". These tbls contain details of invoices, matched and not matched.

Tbl2a is the earliest report and Tbl2b is after the update.

I have worked out the way to find invoices that were on Tbl2a as not matched then on Tbl2b matched.

But I need to know how to query invoices that weren't even on Tbl2a and are matched on Tbl2b.

Any helpers?

Make Sense? I hope so (-:
 
Something like this ?
SELECT B.*
FROM Tbl2b AS B LEFT JOIN Tbl2a AS A ON B.PrimaryKey = A.PrimaryKEY
WHERE B.Matched = True AND A.PrimaryKey Is Null;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Is Null isn't working for me. Is there any other way?

Make Sense? I hope so (-:
 
Is Null isn't working for me
Any error message ? Unexpected result ?
To get accurate answer, please post well formed question.
Feel free to take a look at either one FAQ in my sig.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
No messages.

Its just not displaying any results, and I know that some should be there.

Make Sense? I hope so (-:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top