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: Top Customer List

  1. #1
    GraphicAudio is offline Member
    Join Date
    Jun 2007
    Posts
    48

    Default Top Customer List

    Is there a sql code or way to generate a list of the top customers in our store? We basically want to find out which customers purchased the most products from our aspdotnetstorefront.

    Thanks!

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Try this query:

    HTML Code:
    select c.Customerid, c.Firstname+' '+c.Lastname as Name,c.Email, (select count(*) from Orders_shoppingcart o where o.customerid=c.customerid) as NoOfProductsOrdered from Customer c order by NoOfProductsOrdered desc
    ..that should give you results like this

    HTML Code:
    CustomerID     Name                Email                 NoOfProductsOrdered
    ===================================================
    58640             Customer A       customera@test.com            4

  3. #3
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    purchased the most products by what criteria (qty, frequency, total price)?
    AspDotNetStorefront
    Shopping Cart