我正在创建一个使用crystal的报告,我在运行SQL脚本时认识到,我收到以下错误消息“msg 245 ...将varchar值转换为数据类型int时转换失败。并且报告返回无法打开行集。
这是下面使用的脚本
SELECT DISTINCT "SOLine"."InvtID", "SOLine"."QtyOrd",
"SOHeader"."CustID", "SOLine"."PromDate",
"SOHeader"."ShipCountry", "Inventory"."ClassID",
"SOHeader"."CustOrdNbr", "Inventory"."InvtID",
"SOLine"."QtyBO", "Inventory"."InvtType"
FROM ("Test"."dbo"."Inventory" "Inventory" LEFT OUTER
JOIN "Test"."dbo"."xvr_ SOLines" "SOLine" ON
"Inventory"."InvtID"="SOLine"."InvtID") LEFT OUTER JOIN
"Test"."dbo"."xvr__SOHeader" "SOHeader" ON
"SOLine"."OrdNbr"="SOHeader"."OrdNbr"
WHERE "Inventory"."InvtType"='F'
ORDER BY "Inventory"."InvtType", "Inventory"."ClassID",
"Inventory"."InvtID"
Xvr_solines和xvr_soheader都是创建的视图。当我查看Xvr_Soline视图中显示在报告中并显示错误的字段时,该字段为vachar,并且必须包含数字和字符值。为什么sql会返回错误消息以转换为int?
我错过了什么?这里的任何帮助将不胜感激。
莉莎