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

Thread: SQL Query to show low and out of stock inventory

  1. #1
    Classic_Exotic is offline Member
    Join Date
    Dec 2009
    Location
    Troy, MI USA
    Posts
    82

    Default SQL Query to show low and out of stock inventory

    I'm not a genius at SQL, hopefully someone can assist: I need to write an SQL query to be run from the admin site that will create a custom report that I can access when needed in the custom reports area.

    The query needs to show low stock items with quantities under 10. By default, that type of report would also show out of stocks as I need that info also.

    What is the exact and complete language to run a report such as that?

    It would be great if anyone could pass me the complete needed string - I'm sure it's fairly simple, but I'm not a genius SQL-er.

    Thank you.
    Classic & Exotic Service, Inc.
    Specialty Parts For Prewar Cars
    www.classicandexotic.com

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Do you use complex inventory (eg. your products have Track Inventory by Size and Color set to Yes) or just the default inventory at the product variant level?
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    Classic_Exotic is offline Member
    Join Date
    Dec 2009
    Location
    Troy, MI USA
    Posts
    82

    Default

    We track by default inventory only.
    Classic & Exotic Service, Inc.
    Specialty Parts For Prewar Cars
    www.classicandexotic.com

  4. #4
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Perfect...you can get all product variant information for items that have less than quantity 10 by using the following query
    Code:
    select * from dbo.ProductVariant with(NOLOCK) where Inventory < 10
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  5. #5
    Classic_Exotic is offline Member
    Join Date
    Dec 2009
    Location
    Troy, MI USA
    Posts
    82

    Default

    Thank you - how do I turn this query into a custom report that is stored in the reports area? What is added to the query string in order to do that?
    Classic & Exotic Service, Inc.
    Specialty Parts For Prewar Cars
    www.classicandexotic.com

  6. #6
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Just follow the instructions in our knowledgebase article or the instructions in our manual and use the query I provided in my last post instead of the example query provided in those instructions
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  7. #7
    Classic_Exotic is offline Member
    Join Date
    Dec 2009
    Location
    Troy, MI USA
    Posts
    82

    Default

    Thank you!
    Classic & Exotic Service, Inc.
    Specialty Parts For Prewar Cars
    www.classicandexotic.com