Here is the statement:
SELECT Orders.OrderID, Orders.BatchNumber, Orders.Custom_Field_eBayID
FROM (Products INNER JOIN OrderDetails ON Products.ProductCode = OrderDetails.ProductCode) INNER JOIN Orders ON OrderDetails.OrderID = Orders.OrderID
WHERE Orders.ShipDate IS NULL AND Orders.BatchNumber IS NULL AND Orders.OrderStatus = 'PROCESSING' AND OrderDetails.QtyOnBackOrder <1
Here is a sample of the output I get:
I'm getting 2 problems.
First of all, I only want to see each order number ONCE in the list. (I realise that these are showing multiple times because there are multiple order detail lines on that particular order.) So how do I fix that.
I have the expression WHERE OrderDetails.QtyOnBackOrde
Basically I don't want to pull orders that have items backordered, since I can't ship it.
The problem is that some orders have zero as QtyOnBackOrder and some have NULL as QtyOnBackOrder. The ones with NULL are not showing in the list. So how do I fix that.Thanks!