Stock levels (1 Viewer)

panjap

Blobby
Local time
Yesterday, 18:42
Joined
Feb 7, 2007
Messages
1
hello, i am new to this forum. i have been struggling on a project i am doing where i am tring to calculate the stock levles and keep track of them along with the re order level
i have calculated the current stock levlel, in a query called "stock level 3"
Here the total amount prodcuts sold are taken from the field called stock level.

Here is a break down of my original tables

CUSTOMER

Cu ID
And all their personal details such as contact details


CUSTOMER ORDER
This is where the order takes place and contains the following information


Order_ID
Cu_ID
Staff_ID
Order_Date
Required_Date
Recievied_Date
Order_Total
Delivery
Delivery costs
Overall discount
Type-Of_Purchase
Paid
Money_Owed
Final Costs


CUSTOMER ORDER DETAILS
Here is the specific details of one order.

Order_ID
Prod_ID
Qty_on_Order
Discount
Line_Total

PRODUCTS

Prod_ID
Supp_ID
Product_Name
Product_Type
Prod_ Unit_Details
Qty_in_Stock
Re_Order_level
Price
Unit_Cost
Manufacturer_ID
Shelf_Life

SUPPLIER TABLE – with detaisl e.g Supp Id and account number

SUPPLIER ORDER
Supp_OrderID
Supp_ID

Date_Ordered
Date_Required
S_Delivery_Date
S_Order_Total
Money_Owed Delivery
Driver
Supp_Credit_ Limit
Overall discount
VAT
Type-Of_Purchase

S_Paid
Supp_Final_Costs

SUPPLIER ORDER DETAILS

Supp_OrderID
Prod_ID
Qty
Unit_Detials
Qty_Recieved
Discount
Line_Total


QUERIES

• In the query “All customer order details”, I have worked out the line total for each prodcut with in one order. I have timed the Qty_on_Order (customer order details table) by price (in the produt table) and by the discount(customer order details) this then gives the line total

Now to update the stock level I made a new query called “stock level Query”, where I added up the total number of each products sold, by adding the “Qty_on_Order” from the query “All customer order details”

I then made a new query called “stock level 2” where I calculated the amount left on the shelves by taking “SumOfQty_on_Order” of each product from “Qty_in_Stock” (form prodcuts table) to produce the field called “Qty_in_Stock”

I then made a new query called “stock level 3” where I inserted the same fields but an extra field called “Re_Order_level” for some reason could not add this to the query "stock level 2"


So far the system can add up the total number of products sold, for all the orders, and then automatically calculate the Qty_ in_ stock by taking away the “SumOfQty_on_Order” once a new order is made.


I then made forms where I go in my form to “customer”" and then to “making new order”.
Below is a sub form called “all customer order details sub form” . Here orders are made with defining "Qty_on_Order

I want to make a system which calculates for me i have ordered more stock then there is.
Howcan i now when i make sure when i place a new order in the query"All customer order details" , that if i order above the number of "Qty_in_Stock" (from query srock level 3), from the query “stock level 3”, that when I order more products then ““Qty_in_Stock”, in the query “stock level 3”, does not allow me to enter this and if it is possible please can you insert error messages on it.


I do not know if this helps .- I can not make the “Qty_in_Stock”, to appear in the actual table “Products”.
At the moment I can only update this in the query “stock level 3”. I am not sure if I need this so I can then set re order level which then comes up with an error message telling me when the re order level has been reached. -

As later on I will need to add on any products brought in from the suppliers to the Qty_in_Stock”, in the products table to be automatically updated.


"stock level 3".
here are the fields

Code:
Prod_ID (Products)
Prod_Name (Products)
SumOfQty_on_Order (from "stock level Query")
Qty_in_Stock: Products.Qty_in_Stock-[SumOFQTY_on_Order]
Re_Order_level (Products)


here are both sql from both queries

All customer order details

Code:
SELECT [Customer Order Details].Prod_ID,
Products.Price,
[Customer Order Details].Qty_on_Order,
[Customer Order Details].Discount,
(Products.Price*[Qty_on_Order]*
(1-[Discount])/100)*100 AS Line_Total,
[Customer Order Details].Order_ID,
Products.Prod_Name,
Products.Prod_Type,
[Customer Order].Cu_ID
FROM [Customer Order] INNER JOIN
(Products INNER JOIN [Customer Order Details]
ON Products.Prod_ID=[Customer Order Details].Prod_ID)
ON [Customer Order].Order_ID=[Customer Order Details].Order_ID
ORDER BY [Customer Order Details].Order_ID;



stock level 3

Code:
SELECT [All customer order details].Prod_ID,
Products.Prod_Name, [stock level Query].
SumOfQty_on_Order,
Products.Qty_in_Stock-[SumOFQTY_on_Order] AS Qty_in_Stock,
Products.Re_Order_level,Products.Prod_Name,
[stock level Query].
FROM (Products INNER JOIN [All customer order details]
ON Products.Prod_ID = [All customer order details].Prod_ID)
INNER JOIN [stock level Query]
ON Products.Prod_ID = [stock level Query].Prod_ID
GROUP BY [All customer order details].Prod_ID,
SumOfQty_on_Order,
Products.Qty_in_Stock-[SumOFQTY_on_Order],
Products.Re_Order_level;

please may help me and gice m,e soem tips it will be much appreciated or website/downloads.
Thankyou for your help, and if you find easier ways to do this can you help me.
Thank you so muh.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 20:42
Joined
Feb 28, 2001
Messages
27,253
Search this forum for the topics "Inventory" and "Stock Level" and "Amount on Hand" - plus variants of this topic. We have addressed stock and inventory issues many times.
 

Users who are viewing this thread

Top Bottom