Best selling products in current month

BigCommerce

 

BigCommerce is the leading e-commerce platform for running an online store.

Best selling products (along with total revenue per product) in current month

Query Text

SELECT OrderProducts.Name AS Product, SUM(OrderProducts.Quantity) AS "Number Sold", SUM(OrderProducts.TotalIncTax) AS Revenue
  FROM OrderProducts
LEFT OUTER JOIN Orders AS OrderProducts_Orders ON OrderProducts.OrderId = OrderProducts_Orders.id
WHERE (OrderProducts_Orders.Status != 'Cancelled' AND OrderProducts_Orders.Status != 'Refunded' AND date(date(OrderProducts_Orders.DateCreated), 'start of month') = date('now', 'localtime', 'start of month'))
GROUP BY OrderProducts.Name
  

Open Query