View Single Post
Old 07-11-2012, 10:09 PM   PM User | #1
dla314
New to the CF scene

 
Join Date: Jul 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
dla314 is an unknown quantity at this point
Ambiguous column name 'voltage'

I'm fairly new to SQL and I ran into an Ambiguous column name error. Here's the error I received on my AJAX request:

Code:
<font face="Arial" size=2>
<p>Microsoft OLE DB Provider for SQL Server</font> <font face="Arial" size=2>error '80040e14'</font>
<p>
<font face="Arial" size=2>Ambiguous column name 'voltage'.</font>
<p>
<font face="Arial" size=2>/common/ver7/usmanajax_search_ver7.asp</font><font face="Arial" size=2>, line 135</font>
I was trying to run the following query:
Code:
whereStrSql=" left join excludedproducts E on (E.storeid=" & Session("StoreID") & " and E.id=P2.id) " 
        whereStrSql=whereStrSql & " where " & strsql


	strsql="select P2.voltage,V.voltage voltage2,count(*) as KOL"
	strsql=strsql & " from Lights_America..temp_products P2 "
	strsql=strsql & " left join  voltage V on (P2.voltage=V.id)"
	strsql=strsql & whereStrSql
	strSql=strSql & " group by P2.voltage,V.voltage"
	strSql=strSql & " order by voltage2"
Any help would be greatly appreciated. Thanks in advance.
dla314 is offline   Reply With Quote