If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Check for Values
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 |
#2
|
|||
|
|||
Check for Values
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. "alecgreen" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|