not pulling unmatched records

  • Thread starter Thread starter mary kies
  • Start date Start date
M

mary kies

Guest
Need help meeting a deadline....

I have two tables, the relationship is established with the same fieldname in both tables (productid). Table 1, lists description information of the productid, Table 2 lists activity for the productid. When I try to pull a query, I only get the product id's that are in both tables. How can I make the query pull all records; meaning pull those in table 2 even if it is not in table 1? :confused:
 
Query resonding correctly

Access is performing correctly. I don't understand how you can have activity on a product before first having a description of that product. It sounds like you have a fundamental flaw in the database, you can't have sales activity on chryslers if you only sell dodges. So my question to you is what table is productid the primary key for? I hope it is not a seperate primary key for both tables. You should really force it to be the primary key for your tblDescription, and the foreign key for tblActivity. This way you can't have Activity on an incorrect product. i.e. if you have a product number 5643435 the activity would have to be on that product, and it couldn't be on product 5643535 which may not exist. The whole point of relationships is to prevent what has obviously happened in your database. I would recommend looking at a article on database normalization.
 
Robert is correct.

Are you sure it's not the other way round....

View all Products regardless if they've had an activity or not.
This is a common procedure as you could query Products that have had NO activity.

To do this simply click on the join and select the appropriate join type.
 

Users who are viewing this thread

Back
Top Bottom