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 2 of 2

Thread: Admin Panel: SQL Query - Top 25 Registered customers with Order yes / no status

  1. #1
    hirish.reddy is offline Member
    Join Date
    Jul 2009
    Posts
    40

    Default Admin Panel: SQL Query - Top 25 Registered customers with Order yes / no status

    Hi,

    Admin panel display top 25 registered customers with following details customer ID, Registered Date, Firstname & Last Name.

    I want to display another column Which says order status. If Registered customer place successful order then order status is yes ( display order number) else display Null.

    This can be achieved by joining customer table and order table, but im not that good in writing sql queries. So request some one to help me in doing this job done.

    Thanks in advance

  2. #2
    hirish.reddy is offline Member
    Join Date
    Jul 2009
    Posts
    40

    Default

    Yeah Got it... Im able to see order status in latest register customers table.

    SELECT TOP 25 c.CustomerID,c.RegisterDate,c.FirstName,c.LastName ,c.Phone, o.ordernumber from Customer c Full OUTER JOIN Orders o on c.customerID=o.CustomerID WHERE IsRegistered=1 ORDER BY c.RegisterDate DESC
    Now i can see and contact the customers if they dint place the order in given time. Every one should do this change.


    Advanced Level

    We can also show additional column with total shoppingcart value if customer failed to place the orders, so that we can contact only customers whose shoppingart value is high. If shoppingcart value is zero no need to call them.

    Guys update me if any one able to do this

    Thanks
    Last edited by hirish.reddy; 08-04-2012 at 09:17 AM. Reason: Updated with code