110,538
社区成员
发帖
与我相关
我的任务
分享
select gr.billid,cr.code,cr.billdate,cr.Mobile from goodsrecord gr
left join clientrepair cr on cr.repairid=gr.billid
where ISNULL(gr.goodshabitus,0)=0 and ISNULL(gr.vrhabitus,0)=0 and notetype=50 and
(case ISNULL(cr.tabDate,0)
when 0 then datediff(DAY,cr.billdate,@nowData)
else datediff(DAY,cr.tabDate,@nowData)
end) = @day
group by gr.billid,cr.code,cr.billdate,cr.Mobile
create procedure ud_getRemindRepair
@nowData datetime=null,
@day int=0
as
select gr.billid,cr.code,cr.billdate,cr.Mobile from goodsrecord gr
left join clientrepair cr on cr.repairid=gr.billid
where
datediff(DAY,cr.billdate,isnull(@nowData,cr.billdate)) = @day
group by gr.billid,cr.code,cr.billdate,cr.Mobile