473,379 Members | 1,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

How do I create a query to display the stock remaining of products?

2
Hi there! :)

I am doing a school project in Microsoft Access, but I am having trouble setting up one of my queries....

The two relevant tables are "Products" and "Purchases"

Products
Product ID
Name
Type
Make Price
Supplier ID
Stock When Last Ordered (remaining stock plus quantity ordered when last ordered from supplier)

Purchases
Purchase ID
Date
Product ID
Patient ID
Quantity Purchased

Is there a way to write / run a query to display the stock remaining for each product in the "Products" table (perhaps to subtract the number of times a product has been purchased from the "Stock When Last Ordered" field?)

Thanks so much! :)
Oct 26 '09 #1
3 3612
ChipR
1,287 Expert 1GB
I don't see any way to make use of "Stock When Last Ordered" without other information, like when that was. You could have a field like OriginalStockQuantity in your Products table, and a table to record products and quantities received from a supplier. Then you have a query for total received per product, another for total purchased per product, and a final query with the remaining result.
Oct 26 '09 #2
robjh
2
Thanks! I've updated the tables, but I'm still not sure how to write the suggested queries as i am unfamiliar with SQL language. Help would be greatly appreciated.
:)
Oct 26 '09 #3
ChipR
1,287 Expert 1GB
If you are using the query design view, right click somewhere in the fields in the bottom portion and select Totals. Then, select the Product ID field with Group By, and another field to Sum. Access Help has a very lengthy topic on this, but I recommend experimenting, because it's pretty simple to start with. Once you get it, you can always switch to SQL view to see how the query was written.
Oct 26 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: lee.croucher | last post by:
I'm trying to update my units in stock within a table. This needs to be updated whenever a product is sold. The products which are sold are selected through a combo box on my transaction form. ...
5
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
2
by: David Mitchell | last post by:
I need to have a form which will display all products (from tblproducts) and their stock level (sum of product received from tblacqdetail, minus sum of product sold from tblinvdetail) in a...
1
by: S.Dickson | last post by:
I have a form that has a combo box thats displays all the suppliers I then have subform that shows all the products that we buy from them and how many have been bought and sold therefore work out...
4
by: Jimbo89 | last post by:
Going over the Northwind sample database for practice, I added an update query to the units in stock field of the products table. The scenario being that as a product is ordered, the unitsinstock...
2
by: markcarroll | last post by:
I have a rather complicating query (the SQL is about a page long) so I hope I can solve this without needing to get into specifics. Basically, the database I am working on has information about...
3
by: 100grand | last post by:
Modify the Inventory Program to use a GUI. The GUI should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price...
5
by: brethser | last post by:
Hi All. I have two tables, one with all my products listed and ones that are sold. In a query, I am looking for a way to link them so that the ones that are sold are not displayed in the query...
7
by: HSXWillH | last post by:
I am designing an inventory system and am stuck on a potential problem. I have a table of Stock_Catalog containing the following fields: Stock_ID (random autonumber), Full_Desc, Serial, Auto,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.