Solved

Run Time Error -2147217900 (80040014) - Ambiguous column name 'ID_Company'

Posted on 2014-02-20
3
412 Views
Last Modified: 2014-02-20
This is code I have inherited and have been asked to debug. Screen Shot 1 shows the form that is executed that generates the error. I click 'Debug' and What is seen in Screen Shot 2 appears. I believe the numeric code indicated a possible problem with a Join satement. The .txt file attached shows the SQL statement that the error points to, 'strSQL'.
Could someone verify that I am on the right track and advise what I should do to resolve this error?
Thanks in Advance.
Screen-Shot1.JPG
Screen-Shot2.JPG
SQLstr.txt
0
Comment
Question by:tesla764
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Gary Dewrell earned 500 total points
ID: 39873714
Both tables you are accessing have a column ID_Company. You need to fully qualify the column  table.collumn name so sql knows which ID_Company in which table you are referencing.
0
 

Author Comment

by:tesla764
ID: 39873742
Yes I see that I need to preface the names to make them distinguished.
thanks.
0
 
LVL 12

Expert Comment

by:Gary Dewrell
ID: 39873768
You are very welcome. Have a great day.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question