Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Order History Report to list Best customers

  1. #1
    ceriwholesale is offline Member
    Join Date
    Jan 2009
    Posts
    32

    Default Order History Report to list Best customers

    hi, is there any custom report or query that i can use to find out a report of whom my best customers are? I just need to know their email and past order amount. thanks.

    edwin

  2. #2
    Orangey is offline Junior Member
    Join Date
    Aug 2010
    Location
    UK
    Posts
    23

    Default

    I don't know if there are any built in reports that work better but you can use a simple SQL query like this one:

    Code:
    SELECT CustomerID, FirstName, LastName, Email, COUNT(OrderNumber) AS NumOrders, SUM(OrderTotal) AS OrderTotal
    FROM Orders
    WHERE RefundedOn IS NULL AND VoidedOn IS NULL
    GROUP BY CustomerID, FirstName, LastName, Email
    ORDER BY OrderTotal DESC
    That should give you a list of your customers ordered by how much money they've given you which you could then export to csv or copy into excel or whatever. If you would rather arrange the results by how many times they've ordered just change the "OrderTotal" in the last line of the query to "NumOrders".

    Hope this helps and I've not made any glaring mistakes

  3. #3
    ceriwholesale is offline Member
    Join Date
    Jan 2009
    Posts
    32

    Default

    Thank you Orangey, works like a charm.

    best regards,
    edwin