Find records not listed in other table

ozinm

Human Coffee Siphon
Local time
Today, 20:13
Joined
Jul 10, 2003
Messages
121
OK, it's late (4am) and my brain may have just melted so I appologise in advance if I've missed something stupidly easy.

My problem (simplified):

I have 2 tables called A & B
table A has a primary key called PK_A
table B links to it using a field called Ref_A

E.G.
Table A:
1
2
3
4
5

Table B:
1
1
2
4
2
2

what I want is a query that displays all the records not referenced in table B.
E.G.

Records not in Table B:
3
5


any ideas :confused:
 
SELECT *
FROM [Table A]
WHERE PK_A NOT IN (Select Ref_A from [Table B]);


Alternatively, you can use the Find Unmatch Query Wizard if it has been installed.
 
Last edited:
Duh! Knew I was being stupid.
Thanks!
 

Users who are viewing this thread

Back
Top Bottom