Check for Values

A

alecgreen

Hi

I have 2 tables, requirements and stock on hand. In the requirement
table, I have a part number, qty and due date and a related record in
the stock on hand table using part number showing current stock. My
question is can I use a query (and how!) to tell me

a) I have enough stock to fulfil the requirements and
b) If not at what date will I not be able to fulfil the requirements
and by how many?

Have been working on this for a while, and cant work it out

Regards

Alec
 
J

Jeff Boyce

Alec

You are there, we are not ... the following may not fit your situation ...

If you have a [PartNumber] field in each table, you could start a new query
in design view, add both tables, and join them on [PartNumber].

Then you could create a new field that tells you if there's enough stock ...
maybe something like (untested):

NewField: IIF([qty]<=[currentstock],"Fill the order!","Insufficient
stock on hand")

Then create another new field that tells you the date due and the qty
'short' (untested):

NextNewField: IIF([qty]>[currentstock],"your requirement is short by " &
[qty]-[currentstock] & " and the due date is " & [duedate]

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top