Show all orders for a given product?

Rebecca Thibault asked on April 22, 2015 20:28

Is there a way to view all of the orders for a given product? We need a list of all the people that ordered a certain product and there doesn't seem to be an easy way to view this.

Correct Answer

Rui Wang answered on April 22, 2015 22:32

Rebecca, you will have to create a custom report with custom query which joins 3 tables, COM_Customer, COM_Order, and COM_OrderItem.

SELECT CustomerFirstName, CustomerLastName, OrderID, OrderItemSKUName FROM COM_Customer inner join COM_Order on OrderCustomerID = CustomerID inner join COM_OrderItem on OrderItemOrderID = OrderID WHERE OrderItemSKUName LIKE '%' + @ProductName + '%'

@ProductName is the custom parameter which you can enter product name. Check out these two docs on how to create custom reports with custom parameters:

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.