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!

Duplicate Column Names

Status
Not open for further replies.

rico14d

Programmer
Apr 8, 2002
135
GB
Hi,

Im using a recordset thats a join on 2 tables each with the same column name in them (not the foreign/primary keys).

Is there any way when im referencing the recordset that I can specify which one to return?

At the moment when I ask for rs("status") i just get the first one that is asked for.

I was hoping that I could use rs("table1.status") and rs("table2.status") but it doesnt work.

I know that I could use aliases in the select statement or rs.fields(0) etc, but i would prefer it if there was another way.

Anyone have any ideas? Please let me know if there is no way of doing this, ive posted this question before but nobody said it couldnt be done and im still hoping for a solution!

Rich
 
try this in your statement:

select table1.status as myStatus from ...

then

rs("myStatus")
 
Yes try to use aliases to your common fields.

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top