Forums

This topic is locked

Replace

Posted 11 Feb 2004 20:02:37
1
has voted
11 Feb 2004 20:02:37 Carlos Leal posted:
I have a recordset that is courses and another that is formers, in the courses i have the id of the former, but i want that appear the name of the former in step of the id, in the page curses.asp, i have a filter that appear the select course and the recordset only gives the id...

How do i replace the id by the name of the former, the name is in the table formers.

Thanks

Replies

Replied 19 Feb 2004 14:58:51
19 Feb 2004 14:58:51 Erik Piisila replied:
Sounds like you need to alter your SQL query and that you might only be querying one of the tables.

When you create the recordset, click on the "advanced" tab on the right and make you SQL look like this:

SELECT *
FROM courses, formers
WHERE courses.FormerID= 'MMColParam' AND courses.FormerID= formers.FormerID

Under variables, define MMColParam, give it a default value, and make the runtime value request.querystring("FormerID"


If you just want to display all the courses, you don't need to ad the MMColParam lines. Just:


SELECT *
FROM courses, formers
WHERE
courses.FormerID= formers.FormerID


Then your values will show up under the bindings menu and you will be able to select the title from the formers table

You should only need one recordset. Not two since you are queryiong both tables at the same time.


Edited by - steelerfan70 on 19 Feb 2004 15:00:38

Reply to this topic