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!

Show records that don't match 1

Status
Not open for further replies.

din2005

Programmer
Mar 22, 2005
162
GB
Hi all i have this query which checks the hospno and treatdate and shows all records that match.

the sql is this:

SELECT tExternal.HospNo, tExternal.trtDate
FROM tblTreatmentConv RIGHT JOIN tExternal ON (tblTreatmentConv.TreatConversion = tExternal.trtDate) AND (tblTreatmentConv.HOSP_NO = tExternal.HospNo);

How do you create a query to show records that don't match? I think may be something easy but can't think of how to do it. Any advice will be much appreciated

Many thanks
 
Something like this ?
WHERE tblTreatmentConv.HOSP_NO Is Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thanks again PHV

I don't think i got my query fully right i get a type mismatch error.

The sql is

SELECT tblTreatmentConv.HOSP_NO, tblTreatmentConv.TreatConversion
FROM tblTreatmentConv RIGHT JOIN tExternal ON (tblTreatmentConv.TreatConversion = tExternal.TreatIDImage) AND (tblTreatmentConv.HOSP_NO = tExternal.HospNo)
WHERE (((tblTreatmentConv.HOSP_NO) Is Null));

Could you find anything wrong with this
 
You want the records from WHICH table ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
basically the table texternal will have records that don't match the treatment table.

So i assume its tExternal


thanks
 
SELECT tExternal.HospNo, tExternal.trtDate
FROM tblTreatmentConv RIGHT JOIN tExternal ON (tblTreatmentConv.TreatConversion = tExternal.trtDate) AND (tblTreatmentConv.HOSP_NO = tExternal.HospNo)
WHERE tblTreatmentConv.HOSP_NO Is Null;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top