Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
lagarto
Starting Member
4 Posts |
Posted - 2008-03-03 : 21:25:12
|
| I want to select a few fields from table Detail, and then one field from the table Ink, but when i do this the sql server says: Ambiguous column name 'inkModel'. Can anyone help me out?SELECT userDeptName, userDeptCategory, inkModel, quantity, dateOfTheRequest, AprovedBy FROM Detail INNER JOIN InkON Detail.inkModel = Ink.inkPriceWHERE Ink.inkPrice = 1200.00 |
|
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2008-03-03 : 21:27:13
|
you have to specify which table inkModel is coming from. It is ambiguous because it could come from either table (even though they are the same due to the join)SELECT userDeptName, userDeptCategory, ink.inkModel, quantity, dateOfTheRequest, AprovedBy FROM DetailINNER JOIN Ink ONDetail.inkModel = Ink.inkPriceWHERE Ink.inkPrice = 1200.00 Poor planning on your part does not constitute an emergency on my part. |
 |
|
|
lagarto
Starting Member
4 Posts |
Posted - 2008-03-03 : 21:52:22
|
| Error converting data type varchar to numeric.thats what is comming up now :/ |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-03-03 : 21:57:27
|
| What's the data type of Ink.inkPrice?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
lagarto
Starting Member
4 Posts |
Posted - 2008-03-03 : 22:00:23
|
| decimal(6,2) |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-03-03 : 22:09:55
|
| What data type is Detail.inkModel?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
lagarto
Starting Member
4 Posts |
Posted - 2008-03-03 : 22:27:44
|
| varchar :/ |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-03-03 : 22:33:58
|
| And do you have any data in that column that can't convert to decimal(6,2)? You are joining those two columns together, so they need to be compatible.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|
|
|
|