Query on many to many relationship

tonycl69

Registered User.
Local time
Today, 18:36
Joined
Nov 14, 2012
Messages
53
Hi all, I have a dillema, I have 3 table, vehicles, drivers and the join table all works fine for data entry both sides and interogation both ways. However, becuase one drive can have more than one vehicle at different times, thus showing mutliple entries for a vehicle, I need to print a list of current drivers who have a vehicle, not how many times they had different vehicles, it's fine if I use the join table and mas the startd date, but as soon as I add the drivers in the next query I get vehicle duplications, how can I stop this?
 
Can you post some sample data from your tables along with what you expect from your query based on that sample data? Be sure to include table and field names. Use this format:

Table1Name
field1name, field2name, field3name
4, "Larry", 3/18/2012
7, "Sally", 2/9/2013
 
The PK of your junction table would seem to be made up of

DriverID , VehicleId and TripDate

And this combination should not have any duplicates.
 

Users who are viewing this thread

Back
Top Bottom