Making one field distinct with a "where" clause?

pollardski

New member
Local time
Yesterday, 18:38
Joined
Jun 2, 2007
Messages
8
Hello. I'm making a database to store movie info for a DVD collection. I have a table with fields: title, year, runtime and such. I want an indefinite number of genre to be associated with a movie, so I created a "genre" table and a junction table between that and the "movie" table. Now, on form I want to be able to filter a list of movies based on a genre selection from a combo box. The only way I can see to do this is to make the rowsource of the listbox a query with "tblMovie.MovieID, tblMovie.Title, tblJunction.GenreID" connected through MovieID. This would work except that if a movie is associated with more than one genre on the junction table, the movie appears on the list more than once. I want a movie to appear only once. That's my problem. Thanks in advance for the help.
 
The movie should only have one entry associated with that genre, though, so if you use the genre as a criterion in your query, you'll only get one result.
 

Users who are viewing this thread

Back
Top Bottom