salvador21 Posted August 18, 2013 Share Posted August 18, 2013 What I want to do is extract details of all orders with a specific product ID between two specific dates. The details I would need are basically the customer name and email address. Even just the email addresses would be fine. Can anyone please tell me if this is something that is possible and how to do it? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 18, 2013 Share Posted August 18, 2013 It's probably doable with a database query, but I'm not knowledgeable enough to write it. Hopefully Bsmither will be along and can help you. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 18, 2013 Share Posted August 18, 2013 SELECT first_name,last_name,email FROM CubeCart_order_summary AS os LEFT JOIN CubeCart_order_inventory AS oi ON os.cart_order_id = oi.cart_order_id WHERE os.cart_order_id BETWEEN aaaaaa AND bbbbbb+1 AND oi.product_id = ## Make sure to include any table prefix if your CubeCart database uses one. I chose to use the date that is inherent in the Order Id (first six digits) rather than the Order Date so that you don't have to convert the desired dates to Unix Timestamps 'aaaaaa' would be something like 130701 and 'bbbbbb+1' would be the day after the maximum day, like 130801. '##' is the product_id you are targeting. Quote Link to comment Share on other sites More sharing options...
salvador21 Posted August 18, 2013 Author Share Posted August 18, 2013 Thanks guys, very useful. Also I found another way thanks toi Dirty Butter's reply to my other current question. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.