Skip to content

Instantly share code, notes, and snippets.

@bohnna
Last active December 10, 2015 18:49
Show Gist options
  • Save bohnna/4477528 to your computer and use it in GitHub Desktop.
Save bohnna/4477528 to your computer and use it in GitHub Desktop.
SQL Query for Magento 1.7CE to get customer email, first name, and last name that have not ordered since a specified date.
SELECT ce.email, sfo.customer_lastname, sfo.customer_firstname, ce.updated_at
FROM customer_entity ce
INNER JOIN sales_flat_order sfo ON sfo.customer_email = ce.email
WHERE ce.updated_at BETWEEN '2007-01-07 00:00:00' AND '2012-01-07 23:59:59'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment