Solved

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

Posted on 2014-02-20
3
409 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
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.

856 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