Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-02-20
3
Medium Priority
?
426 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 1500 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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
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.

926 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