日期:2014-05-17 浏览次数:20511 次
Select Min(StartTime), Max(EndTime), SUM(UseTime) as ProUseTimes,SUM(StopTimes) as StopTimes,SUM(StopCount) as StopCount,
0, Count(*) as OrderCount ,0, Sum(TrimAreas) as TrimAreas,
round(Sum((RWeight1+RWeight2+RWeight3+RWeight4+RWeight5+RWeight6+RWeight7)*TrimAreas/Areas),0) as TrimWeight,
SUM(LenM) AS ProLen, SUM(Areas) AS ProArea, SUM(PassQTY) AS ProQTY,
Sum(round((RWeight1+RWeight2+RWeight3+RWeight4+RWeight5+RWeight6+RWeight7)*(PassQTY+LossQTY)/OrderQTY,0)) as ProWeight,
SUM(Round(LossQTY*QlyLenMm/1000,0)) AS LossLen,SUM(LossAreas) AS LossArea,SUM(LossQTY) AS LossQTY,
Round(Sum((RWeight1+RWeight2+RWeight3+RWeight4+RWeight5+RWeight6+RWeight7)*LossQTY/OrderQTY),0) as LossWeight,
0, 0, 0, 0,
Sum(round(RWeight1*(PassQTY+LossQTY)/OrderQTY,0)) as DBCalWei,
Sum(round((RWeight2+RWeight3)*(PassQTY+LossQTY)/OrderQTY,0)) as F1CalWei,
Sum(round((RWeight4+RWeight5)*(PassQTY+LossQTY)/OrderQTY,0)) as F2CalWei,
Sum(round((RWeight6+RWeight7)*(PassQTY+LossQTY)/OrderQTY,0)) as F3CalWei
FROM dbo.FinishData
Where WorkDate between '2013-1-1' and '2013-11-1' and WorkClass='C' and OrderQTY>0 and Areas>0