SQL where条件case when then
where( case when @time1<>@time2 then
(convert(char(10),so.PayDate,120) between @time1 and @time2)
case when @time1=@time2 then (convert(char(10),so.PayDate,120)=@time1))
求大神改改。如果@time1=@time2 条件就是 where convert(char(10),so.PayDate,120)=@time1
如果@time1<>@time2 条件就是 where convert(char(10),so.PayDate,120) between @time1 and @time2