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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Multi-Table SQL Statement Help

Status
Not open for further replies.

llewellyn

Programmer
Sep 26, 2002
6
ZA
Hi
I'm working on an ASP-app which selects data from two different tables in a single db and displays it to the user as options in HTML drop down menus. I might have a table called 'Courses' (like my handle not very creative) with cols 'ID'(Auto number&primary key) and 'Course'. The 2nd table called 'Caddies' with 'IDNUM' and 'Caddy'. In Access I created a relationship between the tables using the 'ID*' cols.
The query I thought of looks like this:
SELECT a.Course,b.Caddy FROM Courses a, Caddies b WHERE
ID=IDNUM.

Now, I think I screwed up with the last part of the statement... the rest I remember from my brief Oracle training.

Can you please help in getting the query to return a recordset? By the way how do I then retrieve the data:
would Response.write(recordSetName("a.Course")); in a loop work?
 

Try this for the SQL Query


SELECT Courses.Course, Caddies.Caddy
FROM Courses INNER JOIN Caddies ON Courses.ID = Caddies.IDNUM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top