I am stuck with a WHERE clause issue that is giving me headaches…
I want to import in Table B (NewOrder) the data from Table A (t1) but only if the data from Table A do not exist in Table C (ArchivedOrder) but only if the field [Status] = ‘processing’
This my WHERE clause and until then it seems to be working:
WHERE NOT EXISTS (SELECT * FROM ArchivedOrder WHERE t1.OrdNB = ArchivedOrder.PO) AND NOT EXISTS (SELECT * FROM NewOrder WHERE t1.OrdNB = NewOrder.PO) AND OrdStatus LIKE 'processing'
The complication comes when I still want to import in Table B from Table A the orders where:
the field [Status] = ‘pending’ and the field [Payment] =’COD’ (both condition must be true)
I don’t know how to add this new condition