YZ_MES/报表sql/Yield_[excel].sql

24 lines
742 B
SQL

select
mfgdate ,
crystalbarno ,
eqpid ,
subprod ,
area ,
area1 ,
qclength QC长度,
qcweight ,
qctime QC检验时间,
adjustcrucible ,
adjustcruciblecode ,
crusize ,
timeinterval ,
erpmoname ERP工单号,
moprodname ,
moproddesc
from
reportdata.siteonlinecrucibleyield s
where 1=1
and qctime >= concat(date_format(now()-8.5/24,'%Y-%m-') ,'01 08:30:00')
##and qctime >= concat(date_format(date_sub(now(),interval 1 month)-8.5/24,'%Y-%m-') ,'01 08:30:00') /*上月第一天 */
and qctime < concat(date_format(now()-8.5/24,'%Y-%m-%d') ,' 08:30:00')
order by qctime