query to display items low on stock

Mark-BES

Registered User.
Local time
Today, 06:12
Joined
Nov 23, 2004
Messages
85
I have a small stock control database built around a Northwind example. I am trying to build a query that displays items low on stock.
On my products form I have:
Min Order Level field (stored value)
Units on Hand (calculated value from products subform (units received-units sold)).

Q1: Do I use a query to calculate/display this?
Q2: How do I construct an expression to acheive this?

Any help much appreciated
 
Q1: Yes you do :D
Q2:
Code:
select * from table1 where minorderlevel => unitsonhand
 
Many thanks for your input, however I am experiencing difficulties.
Please see the attached. This is one example of what I have tried...
 

Attachments

  • example.JPG
    example.JPG
    52.9 KB · Views: 338
I would suggest that your Units on Hand is calculated within a Query and the SubForm field is bound to this value. I don't think you need [Products].[ProductID]=[ProductID] and here I would suggest creating a report based on your Query.

Simon
 
You could create a subquery:
Code:
select productID, sum([Product On Hand]) as SumOfProductOnHand from table1
This query gives you the total [Product On Hand] for each ProductID.
Store this query as qryProductOnHand. Create a second query
Code:
Select tblP.*, qryPOH.SomOfProductOnHand from Products tblP inner join qryProductOnHand qryPOH on tblP.ProductID = qryPOH.ProductID where minorderlevel >= qryPOH.SumOfProductONHand
Be creative!
 

Users who are viewing this thread

Back
Top Bottom