Query to Retrieve Data

S

Shawn C

I have a table that has product ID's and quantites that I need for those
items, and I have another table that has product ID's, qty on hand and entry
date, and I need to be able to build a table that builds up to the qty I need
from what is available in the other table in ascending date sequence.

Any help would be appreciated!
 
D

DStegon via AccessMonster.com

piece of pie....

SELECT tbl_Prod_Have.Prod_ID, tbl_Prod_Have.Prod_DT, [Prod_Need]-[Prod_Have]
AS Prod_Required INTO tbl_New_Prod_Required
FROM tbl_Prod_Have INNER JOIN tbl_Prod_Need ON tbl_Prod_Have.ID =
tbl_Prod_Need.ID
WHERE ((([Prod_Need]-[Prod_Have])>0))
ORDER BY tbl_Prod_Have.Prod_DT;

I tried to name the fields and table so that you would know what goes where.
I created a new table tbl_New_Prod_Required which you can give any name you
want. Because this is a MAKE TABLE qry it will overwrite any existing table
(delete and create new) with the name after the "INTO" section of the query.

You could prompt yourself for a name of the table you want create or append a
date_time_stamp to the file name so that it would always be different each
time it ran.
 

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