473,486 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why is it sometimes necessary to join two fields in one table to two fields in anothe

1 New Member
An Access book I looked at called this topic "creating a relationship on multiple fields." I want to know why this is necessary. For example, I found it necessary to link two fields between two tables in recalculating inventory quantities to reduce appropriately the number of records returned in the query. Two of the 4 tables involved in my inventory queries had a compound primary key, i.e. two fields in the table were primary keys. Do 2 primary keys necessitate two links between tables? If not, what is the reason that two links between 2 tables is necessary?
Jan 22 '15 #1
1 964
jimatqsi
1,271 Recognized Expert Top Contributor
Think about the relationship between the data in the tables. Suppose you sell the same item from more than one warehouse. Imagine a sales order to sell an item. The sales order must specify both the item number and the warehouse to pull stock from. So the relationship between that one line item on a sales order and the item-warehouse table must include two pieces of data to find the right row to reduce the stock from.

If you stop looking in the item-warehouse file after you find the item you may reduce stock from the wrong warehouse. If you look only for the warehouse you may reduce stock for the wrong item.

Jim
Jan 22 '15 #2

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

Similar topics

4
3123
by: Silas | last post by:
Hi, I use view to join difference table together for some function. However, when the "real" table fields changed (e.g. add/delete/change field). The view table still use the "old fields". ...
1
1737
by: Chris Lutka | last post by:
I've been racking my brains all day over this. And I'm not the best at SQL either. I need a query that will produce the following results:...
3
3102
by: DStark | last post by:
Hi! Is it possible to iterate through table fields in an ADP? What I'd like to do is: Sub PrintTableFields() Dim dbs As Object Dim tbl As AccessObject Dim fld As ???? Set dbs =...
3
1898
by: MLH | last post by:
I have a query, qryAppend30DayOld260ies that attempts to append records to tblCorrespondence. When run, it can result in any of the following: appending no records, appending 1 record or appending...
1
1127
by: prisesh26 | last post by:
i ve two tables tblpost and tblreply.. in tblpost i ve three fields postid,title,user and in tblreply postid,replies. postid is primary key for tblpost and i made postid in tblreply as a foreign...
2
6705
by: rcamarda | last post by:
Hello, I need to alter fields in all my tables of a given database, and I would to do this via a t-sql script. Example, I want to change all fields called SESSION_ID to char(6). The field is...
1
1234
by: govindpraveen | last post by:
I have 4 tables 1)category fields -------id-----catrgory 2)Manufacturer fields---------id--------manufacturer---------category_id-------------- 3) Models...
1
1457
by: Vicente | last post by:
The form fields are bound correctly to corresponding table fields. This is a simple table with a simple form (3 fields)
3
1940
by: Daryl Austin | last post by:
I know this can be down, I'm just not sure where to begin. I have a table with fields , basically I am using Access to manage sales proposals. I export out to Excel a report query based on...
0
7105
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.