日期:2014-05-16 浏览次数:20601 次
SELECT a.id ,
c.po_num ,
a.stock_no ,
c.plant ,
c.get_date ,
b.cust_no ,
b.type ,
d.mount ,
d.total ,
a.packageno ,
c.snp ,
b.lotno ,
COUNT(b.lotno)
FROM sgm_ch_check AS a
LEFT JOIN sys_barcode_1d_y AS b ON b.packageno = a.packageno
INNER JOIN sgm_stock_detail AS c ON c.po_num = LEFT(a.stock_no,
CHARINDEX(' ',
a.stock_no) - 1)
INNER JOIN sgm_stock_depart AS d ON d.po_no = a.stock_no
WHERE CONVERT(VARCHAR(10), c.get_date, 120) = '2014-02-25'
AND a.stock_no LIKE '201%'
GROUP BY a.packageno ,
b.lotno
ORDER BY a.stock_no ,
a.packageno ,
b.lotno ASC
select a.id,c.po_num,a.stock_no,c.plant,c.get_date,b.cust_no,b.type,d.mount,
d.total,a.packageno,c.snp,b.lotno,count(b.lotno)
from sgm_ch_check as a