1
当我运行该SQL语句时为int:SQL服务器以为我想转换为varchar使用连字符
SELECT commentor, comment, cdate, ddate
FROM delivery_comments
WHERE Jobno = '93388-01' and ddate = '2016-03-11'
ORDER BY cdate
我得到这个错误:
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value '93388-01' to data type int.
我并不想将其转换为int。我希望它保持varchar
。我该怎么做呢?
delivery_comments中的jobNo是什么数据类型?显示delivery_comments的表格结构。我的猜测是JobNo是整数,所以系统正试图做一个隐式投射,它是失败的。 – xQbert
井盖。它是“int”。这真让我感到厌烦。 – user1548989
:P我无法修复,我猜其他地方的JobNo不是int:P – xQbert