Results 1 to 3 of 3
  1. #1
    samos1023 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    18

    Low Stock report query Question

    I have a inventory database that I am working on that I need to generate a low stock report query. I have most of the logic for the query working, but the final step I'm not sure about. I know logically what I need to do just not how to code it in access. The query I have counts the inventory table by productID and has another column that displays this count. The product table has a field that stores a number for the low stock warning number. These two items are in the query and currently working. I get a list of all items that have a low stock count and a column with how many are in the db. Below is my query view picture, and datasheet view picture
    Click image for larger version. 

Name:	query view.JPG 
Views:	12 
Size:	71.2 KB 
ID:	32319Click image for larger version. 

Name:	datasheet view.JPG 
Views:	12 
Size:	52.5 KB 
ID:	32320
    SQL for the query


    **
    SELECT tblInventory.ProductID, tblManufacturer.CompanyName, tblProducts.PartNumber, tblProducts.LowStockCount, Count(tblInventory.ProductID) AS CountOfProductID
    FROM tblManufacturer INNER JOIN (tblProducts INNER JOIN tblInventory ON tblProducts.ID = tblInventory.ProductID) ON tblManufacturer.ID = tblProducts.ManufacturerID
    GROUP BY tblInventory.ProductID, tblManufacturer.CompanyName, tblProducts.PartNumber, tblProducts.LowStockCount
    HAVING (((tblProducts.LowStockCount)>0));
    **


    The second part is what i don't have working. I want the query to only return records where the count is less than the LowStockCount. I have tried a few things but no luck. How do I put that equation into my query?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    There must be more to your database than what you have shown --Customer, SalesOrder, OrderDetail,PurchaseOrder....

    There is a free generic model for inventory at Barry Williams' site.
    Here is info on ReOrder level
    and Reorder Quantity.

    Here is info re Inventory by Allen Browne that is often referenced when dealing with Inventory Management/Control.

    Here is a link from Blueclaw re Inventory that may useful.
    Hope it's useful to you.
    Last edited by orange; 01-22-2018 at 02:26 PM.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    Just save the query you have that create a new one based on it and simply put the criteria in that one "SELECT * FROM [YourQueryName] WHERE [CountOfProductID]<=[LowStockCOunt];"

    Cheers,
    Vlad

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 10-23-2017, 11:56 PM
  2. Replies: 4
    Last Post: 12-16-2016, 09:57 AM
  3. Printing report on 8.5 by 5.5 stock
    By dboyer in forum Access
    Replies: 1
    Last Post: 02-23-2016, 04:53 PM
  4. SQL Update stock Query HELP!!!
    By jordanturner in forum Queries
    Replies: 6
    Last Post: 09-06-2010, 10:34 AM
  5. Replies: 1
    Last Post: 02-02-2009, 05:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums