Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Magento Reporting Functionality
0
votes
1
answer
37
views
Number of Customers Total Spend in the Past Year Output into £20 Ranges
I'm basically looking to build a query that'll return the number of customers in sales_flat_order who have spent in total year to date:
Between £0 and £20
Between £20.01 and £40
Between £40.01 and £ …
0
votes
Accepted
Number of Customers Total Spend in the Past Year Output into £20 Ranges
This is what I came up with:
SELECT
LowerBound, UpperBound, count(1) AS CustomersInBound
FROM (
SELECT
customer_id,
cast(sum(subtotal_invoiced)/20 as unsigned) * 20 as Lower …