When running the following query against MS SQL Server 7.0:
SELECT
documentitems.manufacturerpartnumber,documentitems.customnumber01,documenthe
aders.customnumber01,documentit
ems.description,documentheaders.projectno FROM DocumentHeaders INNER JOIN
DocumentItems ON
DocumentHeaders.ID = DocumentItems.DocID WHERE (
DocumentHeaders.DocNo='ORLQ1017' AND
DocumentItems.CustomNumber01=2)
It returns 2 records (Which is correct). The problem that I am having is
that I include in the query that
I want the DocumentHeaders.CustomNumber01 field AND the
DocumentItems.CustomerNumber01 field. The field
names in the two different tables are the same. The issue that I have is
that in the query results that
SQL Server returns, it returns two columns with the same name
"CustomerNumber01" and "CustomerNumber01".
SQL Server is not prefixing the field names with the table names like I did
when submitting the query.
This makes it impossible for me the retrieve the separate field values. Is
there a way to get SQL Server
to return the table qualified names of these same named fields?
I am using ADO with Visual Basic 6 to do the query, but I would think in
theory the query should be able to be run in MS Query Analyzer or VB.