Query showing multiple record

How come OrderID=22 and OrderID=23 do not show up in the final data?
 
How come OrderID=22 and OrderID=23 do not show up in the final data?


Please see the attachment, I think its better describe.
 

Attachments

  • Sample.png
    Sample.png
    42.4 KB · Views: 98
It describes nothing, it just shows data. How come OrderId=22 and OrderID=23 are not in the final data the query is to produce?
 
I have no idea what that means. The data you posted as what the query was to return was just OrderID=20 and OrderID=21 (Post #20). Was that not the data the query was to return based on whats in the database you posted?

Last chance. Using the data in the tables that you last posted (Post #14), show me the exact values that the query should return.
 
I have no idea what that means. The data you posted as what the query was to return was just OrderID=20 and OrderID=21 (Post #20). Was that not the data the query was to return based on whats in the database you posted?

Last chance. Using the data in the tables that you last posted (Post #14), show me the exact values that the query should return.

Thanks by the way spending that much time with me.

OrderID, OrderDate, ProductID, OrderQty, ProductionDate, ProductionCode, Production Qty.
20 08/18/14 236 1000 08/18/14 236 100
21 08/17/14 236 2000 08/19/14 10101 200
22 08/19/14 236 3000
23 08/19/14 236 4000
24 08/19/14 3609 5000
25 08/21/14 10109 1500

Hope I explain properly this time, if not thanks again for your time.
 
How come OrderID=22 and OrderID=23 do not have Production Data?

If you look in tblProduction there is a ProductCode=236 which would match up with ProductID=236 in tblOrders for OrderID=22 and OrderID=23.

How come that data doesn't show up? Is it because the ProductionDate is after the OrderDate?
 
How come OrderID=22 and OrderID=23 do not have Production Data?

If you look in tblProduction there is a ProductCode=236 which would match up with ProductID=236 in tblOrders for OrderID=22 and OrderID=23.

How come that data doesn't show up? Is it because the ProductionDate is after the OrderDate?

Our production is always after the order date, Orders added 2 weeks prior to production. Check the post #9,
 
Post #9 didn't help. Tired of trying to drag information out of you. Here's the code I have built on the assumption that Production data isn't to be included if it is after the Order data:

Code:
SELECT tblOrder.OrderID, tblOrder.OrderDate, tblOrder.ProductID, tblOrder.OrderQty, tblProduction.ProductionDate, tblProduction.ProductionCode, tblProduction.ProductionQty
FROM tblOrder LEFT JOIN tblProduction ON (tblOrder.OrderDate<=tblProduction.ProductionDate) AND (tblOrder.ProductID = tblProduction.ProductionCode);

Hope that works. Good luck
 
Post #9 didn't help. Tired of trying to drag information out of you. Here's the code I have built on the assumption that Production data isn't to be included if it is after the Order data:

Code:
SELECT tblOrder.OrderID, tblOrder.OrderDate, tblOrder.ProductID, tblOrder.OrderQty, tblProduction.ProductionDate, tblProduction.ProductionCode, tblProduction.ProductionQty
FROM tblOrder LEFT JOIN tblProduction ON (tblOrder.OrderDate<=tblProduction.ProductionDate) AND (tblOrder.ProductID = tblProduction.ProductionCode);

Hope that works. Good luck

Thanks Brother
 

Users who are viewing this thread

Back
Top Bottom