• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

VB.net SQL The objects in the FROM Clause have the same exposed names

Hi. I get the following error in the SQL Statement built below. How do I rectify this

The objects Polycom_Products and Polycom_Products in the FROM Clause have the same exposed names. Use correlation names to distinguish them

            Dim sSQL As String
            sSQL = "Select Polycom_Products.*, Photos.* "
            sSQL = sSQL & " From Polycom_Products Left Join Photos On Polycom_Products.Category2 = Photos.Category2 And Polycom_Products.Category3 = Photos.Category3"
            sSQL = sSQL & ",Polycom_Products Left Join Costs On Polycom_Products.[Product ID] = Costs.[ProdID]"
0
Murray Brown
Asked:
Murray Brown
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
It seems that you have fields with the same name in both tables (like Category2 and Category3).

Instead of querying for all fields (*), specify the name of the fields you want without duplicates.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now