98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » Queries
Queries
Resolved · Low Priority · Version 2003
Dan has attended:
Access Introduction course
Queries
How can a formula be incorporated into a query for instance to link a unit quantity of sales to the unit price to come up with transaction value if the unit price is in the product table and the sales quantity is in a transaction table?
RE: Queries
Hi Dan, Thanks for the post, welcome to the forum, the answer to your question lies in relationships, when a table is created in Access it must be focused on its unique key, (eg everything in the table relates to the ID field), if this is the case and we create all our tables with this primary rule in mind then we can utilise Access as it is supposed to be; a Multi Relational Database, this means that tables are joined (or relationships are created through their primary keys); for example in its simplest form using the most common of relationships, a one to many join, one department has many employees, or one product can be ordered many times, (lots of packs of strawberries, each order for different number of packs) so when we create a query to show which employees are in which department Access will look for those employees who display a particular department ID and show them together. In the same way when we create a calculated field which extracts information from two different tables, (Products and Orders,) because they are linked, the query will calculate the values from each table using the joining fields to access the information. So in your example the query would be something like this: --- Transaction Value:[Product.Unit_Price]*[Transaction.Sales_Quantity] and so long as there is a link between the two tables (in the Transaction table the Product ID is shown as having been the item sold) then Access will extract the information and display the correct values. I hope that has helped, if so, please click the Resolved link, best regards Pete
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Combo box for finding recordsYou can use a combo box in a form to look up a record. If you place the comb box in the Form header, by then selcting they a field type from the drop down loist, you will see the record for it |