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

join problem

Status
Not open for further replies.

jordan11

Technical User
May 24, 2003
150
GB
Hi,

I have this select statement,
select o.questionID,p.questionid
from opportunityanswers o inner join physiciananswers p
on o.questionID = p.questionID
and physicianID='128'

I would to use 0.question in my query below

I tried this questionid=rs(o.questionID)

and then tried to use questionid in my asp page

and I keep on getting an error

Item cannot be found in the collection corresponding to the requested name or ordinal.

if i run the same query in sql analyser i get the results i want.


Thanks in advance
 
sorry but in my page i did have the quotes around the rs("o.questionID")
but i still get that same error
 
oops..sorry it should be:

questionid=rs("questionID")

with o

-DNG
 
ok now got it...try this:

select o.questionID as oQuestionID,p.questionid as pquestionID
from opportunityanswers o inner join physiciananswers p
on o.questionID = p.questionID
and physicianID='128'

now you can do...

questionid=rs("oquestionID") or

questionid=rs("pquestionID")

-DNG
 
thanks DNG
I found out what the problem was as your suggestion did not work either so i had a closer look at my query.

I had conn.Execute txtsql
and my sql statement=txttsql

that change made it worked


thanks once again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top