A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Check for Values



 
 
Thread Tools Display Modes
  #1  
Old February 5th, 2010, 09:16 PM posted to microsoft.public.access.queries
alecgreen
external usenet poster
 
Posts: 45
Default 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  
Old February 6th, 2010, 12:25 AM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.