The following is two tables in a database
tblTemp
TempPK AutoNumber
PsNo String
tblOrders
OrderPK AutoNumber
PsNo String
Both tables have several more fields, but the only common field between them is PsNo. No relationship between them.
I'm trying to write a query that shows a list of All PsNo from tblTemp that doesn't exists in tblOrders.
I tried this :
The query runs and shows 922 records.
I checked 10 random PsNo from the result, but a search showed that the same PsNo exists in tblOrders.
How can I get a list of PsNo from tblTemp that don't exist in tblOrders?
Thanks for any kind of advice.
PS: I can have the result with vba, but I prefer having a query for this job (if possible)
tblTemp
TempPK AutoNumber
PsNo String
tblOrders
OrderPK AutoNumber
PsNo String
Both tables have several more fields, but the only common field between them is PsNo. No relationship between them.
I'm trying to write a query that shows a list of All PsNo from tblTemp that doesn't exists in tblOrders.
I tried this :
SQL:
SELECT TempPK, PsNo FROM tblTemp
WHERE Not Exists
( SELECT * FROM tblOrders WHERE tblTemp.PsNo=tblOrders.PsNo)
I checked 10 random PsNo from the result, but a search showed that the same PsNo exists in tblOrders.
How can I get a list of PsNo from tblTemp that don't exist in tblOrders?
Thanks for any kind of advice.
PS: I can have the result with vba, but I prefer having a query for this job (if possible)