if(@pid=0)
begin
set @cidV=' and Member_provinceid not in
(1000,1001,1003,1054,1079,1086,1088,1089,1090,1142,1166,1184,1199,1207,1262,1291,1310,1356,1360) '
end
else
BEGIN
set @cidV=''
end
SELECT * into #GroupTb from
(
select member_id,cid,Group_name ,cCompany,Member_groupid,Member_startdate, Member_enddate,
Group_outlay,Group_membertype,Group_term,Group_unit,
Member_provinceid,Member_capitalid
FROM JOB_Group G RIGHT JOIN JOB_Member M
on G.Group_id=M.Member_groupid
LEFT JOIN JOB_CRM_Client c
on c.comid=M.Member_id
LEFT JOIN JOB_admin a
on a.JOB_id=c.cUser
GROUP BY member_id,cid,cUser,Group_name ,cCompany,Member_groupid,Group_membertype ,Group_outlay,Member_startdate,Member_enddate,Group_term,Group_unit,
Member_provinceid,Member_capitalid
having Group_membertype=2 and datediff(month,Member_enddate,convert(varchar(23),[email protected]))=0
[email protected][email protected]
) t
消息 245,级别 16,状态 1,过程 proc_CustomerVIP,第 26 行
在将 varchar 值 ' and Member_provinceid not in
(1000,1001,1003,1054,1079,1086,1088,1089,1090,1142,1166,1184,1199,1207,1262,1291,1310,1356,1360) ' 转换成数据类型 int 时失败。
------解决方案--------------------
@cidV 你定义了 int型, 而你副一个不能转换成int型的字符串,所以报错