Created
April 7, 2018 18:33
-
-
Save drobinson/9bc8de824f9a9c49af2898001a3b150f to your computer and use it in GitHub Desktop.
Simple historical payment information report by month
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select year(sfo.created_at) as year, monthname(sfo.created_at) as month, method, count(sfop.entity_id) as orders, round(sum(amount_paid), 2) as total_revenue from sales_flat_order_payment as sfop | |
left join sales_flat_order as sfo on sfop.parent_id = sfo.entity_id | |
group by year(sfo.created_at), month(sfo.created_at), method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment