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: Query Distributor Cost by Order

  1. #1
    cheesenips is offline Junior Member
    Join Date
    Mar 2008
    Location
    Phoenix Arizona
    Posts
    8

    Default Query Distributor Cost by Order

    Hello I am in need of some help, I need to Query the total (Actual Cost including ALL Distributors) for orders and get the cost for one poticular Distributor on orders. I see this information if I go into the Order Details page and click on the DISTRIBUTOR link in the frame window, but I can't find this information anywhere in the DB. Can someone help me out.

    Thanks
    Ryan

  2. #2
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    Don't know if this is what you're looking for, but it's a starting point:

    Code:
    SELECT osc.distributorid, d.[name], COUNT(*) AS NumOrders, ROUND(SUM(orderedproductprice),2) AS TotalPrice, SUM(quantity) AS TotalQuantity
    FROM orders_shoppingcart AS osc
    JOIN distributor AS d ON d.distributorid = osc.distributorid
    WHERE orderedproductsku <> 'ADHOCREFUND'
    GROUP BY osc.distributorid, d.[name]
    ORDER BY d.[name]
    Create it as a custom report, or use SQL Server Management Studio
    Last edited by esedirect; 09-15-2010 at 01:37 AM.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!