--hj and hj.productiondate = @CheckDate and left(a.productid, 4) *= left(hj.productid, 4) and hj.productid like '____06' and left(a.productid, 4) + '06' *= hjtoday.productid and hjtoday.checkdate = @CheckDate and left(a.productid, 4) + '06' *= hjyesterday.productid and hjyesterday.checkdate = @YesterdayOfCheckDate --sx and sx.productiondate = @CheckDate and left(a.productid, 4) *= left(sx.productid, 4) and sx.productid like '____08' and left(a.productid, 4) + '08' *= sxtoday.productid and sxtoday.checkdate = @CheckDate and left(a.productid, 4) + '08' *= sxyesterday.productid and sxyesterday.checkdate = @YesterdayOfCheckDate --jt and jt.productiondate = @CheckDate and left(a.productid, 4) *= left(jt.productid, 4) and jt.productid like '____07' and left(a.productid, 4) + '07' *= jttoday.productid and jttoday.checkdate = @CheckDate and left(a.productid, 4) + '07' *= jtyesterday.productid and jtyesterday.checkdate = @YesterdayOfCheckDate --ph and ph.productiondate = @CheckDate and left(a.productid, 4) *= left(ph.productid, 4) and ph.productid like '____09' and left(a.productid, 4) + '09' *= phtoday.productid and phtoday.checkdate = @CheckDate and left(a.productid, 4) + '09' *= phyesterday.productid and phyesterday.checkdate = @YesterdayOfCheckDate --zj and zj.productiondate = @CheckDate and left(a.productid, 4) *= left(zj.productid, 4) |