Question : multiple JOINs ON equal AND NOT equal

I am trying to join a table and query together where the PO_Details number is equal BUT the aggregate quantity of the query (qryMeasureTotal.MeasureQuantityTotal) and quantity of the table (tblPO_Details.Quantity) are not equal.


Is there a way to create multiple joins on fields being equal and other fields being not equal.

My SQL below is not working.

Thanks,
JOe K.
Code Snippet:
1:
2:
SELECT tblPO_Details.PO_ID
FROM tblPO_Details INNER JOIN qryMeasureTotal ON (tblPO_Details.Quantity <> qryMeasureTotal.MeasureQuantityTotal) AND (tblPO_Details.PO_DetailsID = qryMeasureTotal.fkPO_Details);

Answer : multiple JOINs ON equal AND NOT equal

this should do it:
1:
2:
3:
4:
5:
6:
select d.PO_DetailsID, d.Quantity , m.MeasureQuantity , d.Quantity - m.MeasureQuantity 
  from tblPO_details d
  join qryMeasureTotal m
    on  d.PO_DetailsID = m.fkPO_Details 
   AND d.Quantity <> m.MeasureQuantity
 
Random Solutions  
 
programming4us programming4us