Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get all customers payment methods between range of dates from Magento database
SELECT
o.grand_total AS 'Order Total',
o.created_at AS 'Payment Day',
p.method AS 'Payment Method',
CONCAT_WS(' ', o.customer_firstname, o.customer_lastname) AS 'Customer Name',
o.increment_id AS 'Order Number'
FROM sales_flat_order o
LEFT JOIN sales_flat_order_payment p ON p.entity_id = o.entity_id
WHERE (o.created_at BETWEEN '2016-01-01' AND '2016-12-31')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.