我正在尝试执行以下操作
set @STARTDATE = '2018/06/01 00:00:00';
set @ENDDATE ='2018/06/30 23:59:59';
set @i_id = aaa;
select count(distinct rj.policy) into @rp from rps rj
inner join sentps sp
on rj.p = sp.p
where
rj.entry_date between @startdate and @enddate
and sp.start_date between @startdate and @enddate
and rj.i_id = @i_id
and code1 like 'w%'
and datediff(rj.Entry_date, sp.start_date) >= 14;
select @rp as rpl
由于truncated double value error
,脚本返回的值为0,但是,如果我删除了into @rp
,脚本将正常工作并返回正确的值。 into @RP
是整个脚本的组成部分,稍后将在百分比计算中使用。任何建议将不胜感激