62,046
社区成员
发帖
与我相关
我的任务
分享
ALTER PROCEDURE [dbo].[bb]
@rectime1 datetime,
@rectime2 datetime,
@bianhaoid int,
@banci int
AS
BEGIN
if (@rectime1<>0 and @rectime2<>0)
begin
SELECT bianhaoid , riqi, banci , chanpin ,
kaicheshiijan , tingcheshijian, tingchecishu ,
michang
from bcgl
where 1=1
and (riqi between @rectime1 and @rectime2 )
and (case @bianhaoid
when = 0 then 1=1
else bianhaoid = @bianhaoid
end)
and (case@banci
when = 0 then 1=1
else banci = @banci
end)
and (bcgl.kaicheshiijan<>'' )
end
END
and bianhaoid =(case @bianhaoid
when 0 then bianhaoid
else @bianhaoid
end)