日期:2014-05-18 浏览次数:20730 次
select * from( select pj.projectNo, cast(v_feeTypeVer.itemName as float) feeTypeVer from CommonData.dbo.base_t_project pj join CommonData.dbo.base_ref_packageVer_feeTypeVer rpf on rpf.if_packageVerId=pj.if_packageVerId join CommonData.dbo.base_v_infoClass v_feeTypeVer on v_feeTypeVer.itemId=rpf.if_feeTypeVerId where v_feeTypeVer.parentName='短信' )a where a.feeTypeVer>=1.3 消息 8114,级别 16,状态 5,第 2 行 从数据类型 varchar 转换为 float 时出错。
select * from( select pj.projectNo, cast(v_feeTypeVer.itemName as float) feeTypeVer from CommonData.dbo.base_t_project pj join CommonData.dbo.base_ref_packageVer_feeTypeVer rpf on rpf.if_packageVerId=pj.if_packageVerId join CommonData.dbo.base_v_infoClass v_feeTypeVer on v_feeTypeVer.itemId=rpf.if_feeTypeVerId where v_feeTypeVer.parentName='短信' )a where a.feeTypeVer>='1.3'
------解决方案--------------------
select * from( select pj.projectNo, cast(v_feeTypeVer.itemName as float) --这里有错,八成是你的字符串里 面含有非数字字符,比如说123ae.23这样的字符串 feeTypeVer from CommonData.dbo.base_t_project pj join CommonData.dbo.base_ref_packageVer_feeTypeVer rpf on rpf.if_packageVerId=pj.if_packageVerId join CommonData.dbo.base_v_infoClass v_feeTypeVer on v_feeTypeVer.itemId=rpf.if_feeTypeVerId where v_feeTypeVer.parentName='短信' )a where a.feeTypeVer>=1.3