Exporting All Pending and In Review Orders


You may want to retrieve all orders in Pending or Review (On Hold) status including the items and dollar amount per order.




  1. Connect to the database.
  2. Run the following query for the required brand.
    SELECT distinct convert_tz(o.created, 'utc', 'us/pacific') as 'Order Date', o.order_id as 'Order ID',ROUND(s.price/100,2) as 'Order Amount', o.member_id as 'Customer ID', o.product_id as 'SKU', o.productCluster_id as 'Product ID', o.units as 'Quantity', ROUND(o.itemPrice/100,2) as 'Item Price', o.status as 'Item Status',datediff(convert_tz(now(), 'utc', 'us/pacific'), convert_tz(o.created, 'utc', 'us/pacific')) as 'Days Waiting' from VW_O o 
    JOIN SPOrder s ON s.id = o.order_id where o.site = '<brand>' and (o.status = 'PENDING' or o.status = 'REVIEW') order by 'Days Waiting' desc;
  3. Export the query results as a CSV.
  4. Filter the orders for the required date range (if needed) and send the file to the brand.




Article is closed for comments.