2,499
社区成员
发帖
与我相关
我的任务
分享
' where s.cdt>='+st+' and s.cdt <='+et+ 'and w.macno <>'+Quotedstr('');
var
st: string;
et: String;
st:=datetostr(datetimepicker1.date)+' '+FormatDateTime('hh:nn:ss',DateTimePicker2.DateTime);
et:=datetostr(datetimepicker3.date)+' '+FormatDateTime('hh:nn:ss',DateTimePicker4.DateTime);
sqlstr :='select w.csno as SN,w.macno as macAddress,s.model,s.cdt AS Date,c.wcname as TestStation, '
+' (case s.ispass when 0 then '+Quotedstr('FAIL')+' else '+Quotedstr('PASS')+' end) as [TestResult], '
+' (case s.ispass when 0 then f.defect else '+Quotedstr('')+' end) as [FailCode], '
+' (case s.ispass when 0 then d.doc else '+Quotedstr('')+' end) as [FailureReason],'+Quotedstr('')+' as DefectType,'+Quotedstr('')+' as RefDes,'+Quotedstr('Sercomm')+' as [ODM] '
+' from sfc_log s with(nolock) '
+' full join wosn09 w with(nolock) '
+' on w.pcb + w.isno = s.isno '
+' full join wc c with(nolock) '
+' on s.wcno = c.wcno '
+' full join sfc_dftm d with(nolock) '
+' on s.isno = d.isno '
+' full join defect f with(nolock) '
+' on d.defect = f.defect '
+' where s.cdt>='+Quotedstr(ST) +' and s.cdt <='+Quotedstr(ET)+ ' and w.macno <>'+Quotedstr('');
with ADOQuery1 do
begin
ADOQuery1.close;
ADOQuery1.sql.Clear;
ADOQuery1.sql.Add(sqlstr);
ADOQuery1.open;
label4.Caption:='共找到'+inttostr(adoquery1.RecordCount)+'条记录。';
end;
var
st: string;
et: String;
st:=datetostr(datetimepicker1.date)+' '+FormatDateTime('hh:nn:ss',DateTimePicker2.DateTime);
et:=datetostr(datetimepicker3.date)+' '+FormatDateTime('hh:nn:ss',DateTimePicker4.DateTime);
sqlstr :='select w.csno as SN,w.macno as macAddress,s.model,s.cdt AS Date,c.wcname as TestStation, '
+' (case s.ispass when 0 then '+Quotedstr('FAIL')+' else '+Quotedstr('PASS')+' end) as [TestResult], '
+' (case s.ispass when 0 then f.defect else '+Quotedstr('')+' end) as [FailCode], '
+' (case s.ispass when 0 then d.doc else '+Quotedstr('')+' end) as [FailureReason],'+Quotedstr('')+' as DefectType,'+Quotedstr('')+' as RefDes,'+Quotedstr('Sercomm')+' as [ODM] '
+' from sfc_log s with(nolock) '
+' full join wosn09 w with(nolock) '
+' on w.pcb + w.isno = s.isno '
+' full join wc c with(nolock) '
+' on s.wcno = c.wcno '
+' full join sfc_dftm d with(nolock) '
+' on s.isno = d.isno '
+' full join defect f with(nolock) '
+' on d.defect = f.defect '
+' where s.cdt>='+Quotedstr(ST) +'and s.cdt <='+Quotedstr(ET)+ 'and w.macno <>'+Quotedstr('');
with ADOQuery1 do
begin
ADOQuery1.close;
ADOQuery1.sql.Clear;
ADOQuery1.sql.Add(sqlstr);
ADOQuery1.open;
label4.Caption:='共找到'+inttostr(adoquery1.RecordCount)+'条记录。';
end;