CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Ambiguous column name

Print topic Send  topic

Author Message
Trisiana
Posted: 02/19/2004, 10:29 PM

Hi, I got this error when I try to link table people and category using
category_id. I already tried to use field alias category_id1 and
category_id2 but still got the same error. Any help will be very nice...
====================
Form: Grid People
Error: Ambiguous column name 'category_id'. (Microsoft OLE DB Provider for
SQL Server)

DonB
Posted: 02/20/2004, 6:13 AM

It's saying that the category_id appears in both tables and doesn't know
which one to reference. You need to alias the tables, not the column, and
specify the alias in your select;

SELECT p.category_id, c.category_id FROM people AS p, category AS c ON
p.category_id = c.caegory_id


--
DonB

http://www.gotodon.com/ccbth


"Trisiana" <trisiana.tana@lycos.co.uk> wrote in message
news:c149fe$uq8$1@news.codecharge.com...
> Hi, I got this error when I try to link table people and category using
> category_id. I already tried to use field alias category_id1 and
> category_id2 but still got the same error. Any help will be very nice...
> ====================
> Form: Grid People
> Error: Ambiguous column name 'category_id'. (Microsoft OLE DB Provider for
> SQL Server)
>
>

Suntower

Posts: 221
Posted: 02/09/2005, 12:10 PM

I just got this error when I try to sort on any column that has a duplicate name in a joined table.

I -have- aliased all tables and column names in my SELECT statement. The only thing I can think of is that I'm using a SQL statement rather than a Table.

Any ideas?

TIA,

---JC

SELECT PRO.PRODUCTID, PRO.SPEC, PRO.FORMNUMBER, PRO.DESCRIPTION,
PRO.SELLUOFM, PRO.CATEGORY1, PRO.DEFAULTSALESRELEASEQUANTITY,
PRO.ONHANDQUANTITY,
PROI.FILENAME
FROM Products AS PRO LEFT OUTER JOIN ProductImages AS PROI ON PRO.ProductID = PROI.ProductID
WHERE PRO.InternalUseOnly<>1 AND PRO.FMS=1 AND PRO.CustomerID='00LETTUC'
_________________
---On a campaign for more examples and better docs!
View profile  Send private message
mrachow


Posts: 509
Posted: 02/10/2005, 12:19 AM

What happens when you use the unaliased column name for "ordering"?
_________________
Best regards,
Michael
View profile  Send private message
DonB
Posted: 02/10/2005, 6:54 AM

Try filling in the Sort Order property of your Sorters with the
fully-qualified column name. I would guess right now it's blank or just the
column name (without the table alias).

--
DonB

http://www.gotodon.com/ccbth
Suntower

Posts: 221
Posted: 02/10/2005, 9:48 AM

Who's da man? YOU da man!

Cheers,

---JC


Quote DonB:
Try filling in the Sort Order property of your Sorters with the
fully-qualified column name. I would guess right now it's blank or just the
column name (without the table alias).

--
DonB

http://www.gotodon.com/ccbth


_________________
---On a campaign for more examples and better docs!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.