Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an Access query: Query By Example - Still need help

Status
Not open for further replies.

Australia

Technical User
Jan 21, 2003
4
0
0
AU

Thanks Allanon. But the code you provided asks several questions other than Director name when the query is executed. But I need only the Director name to be asked by the user.
The exact table structures are:
1) Director
Director ID, Name, Address, City, Postcode, Date Of Birth
2) Movie
Movie ID, Title, Genre, Rating, Duration, Director ID
3) DVD
DVD ID, Title, Year Of First Release, Purchase Year, Purchase Price, Movie ID

-----------------------------------------------------------
>australia (Visitor) May 27, 2002
Thanks for the two replys. But my problem is still not solved.

Actually I need to create a query. And I do not want to ask any other question from the user other than 'director name'. So how can we provide a SQL query so I can replace it in the SQL view of my Access query.

--------------------------------
>My original question was:

I have three tables called DVD, Movie and Director. I need to create a query to ask the user for the name of a director and retrieve the DVDs directed by that director.

Director - Movie (Director ID is the foreign key in the Movie table)
Movie - DVD (Movie ID is the foreign key in the DVD table)

Please help me in code...

 
Select d2.Name, m.Title As [Movie Title], d1.*
From DVD As d1
Inner Join Movie As m
On d1.MovieID=m.MovieID
Inner Join Director As d2
On m.[Director ID]=d2.[Director ID]
Where d2.Name Like [Enter a Director Name] & "*"
Or [Enter a Director Name] Is Null;

You'll have to modify to select the columns you want to see in the result. The last line "Or [Enter a Director Name] Is Null" is included to allow the user to select DVDs by all directors. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top