SUM(case when (pp.inventory=30 and regtime>=dateadd(dd,-3,@sbegt) and regtime<=@sendt) then weight else 0 end) [Rest]
> 1