R
ray_shan
Unregistered / Unconfirmed
GUEST, unregistred user!
這是我的源碼 ;
procedure TForm1.BitBtn1Click(Sender: TObject);
var
sqlstr :string;
time1 ,time2 : string;
i : Integer ;
begin
Series1.Clear;
time1 :=DateToStr(DateTimePicker1.Date)+' '+timetostr(DateTimePicker2.time);
time2 :=DateToStr(DateTimePicker3.Date)+' '+timetostr(DateTimePicker4.time);
with ADOQuery1 do
begin
close;
sql.Clear;
sqlstr :='select process Stations,count(distinct unit_id) InputQty from unit_status ';
sqlstr :=sqlstr +' where serial_number in (select track_id from TRACK_MASTER where front_end_job_id=''81001789'') and ' ;
sqlstr :=sqlstr +' modified_date>=to_date(''' + time1 + ''',''yyyy/mm/dd hh24:mi:ss'') and modified_date<=to_date(''' + time2 + ''',''yyyy/mm/dd hh24:mi:ss'') and ';
//sqlstr :=sqlstr +' modified_date between :a and :b and ';
sqlstr :=sqlStr + ' process in (''CMT'',''RFC'',''MIT'',''RFT'') group by process ' ;
sql.Add(sqlstr);
Open;
procedure TForm1.BitBtn1Click(Sender: TObject);
var
sqlstr :string;
time1 ,time2 : string;
i : Integer ;
begin
Series1.Clear;
time1 :=DateToStr(DateTimePicker1.Date)+' '+timetostr(DateTimePicker2.time);
time2 :=DateToStr(DateTimePicker3.Date)+' '+timetostr(DateTimePicker4.time);
with ADOQuery1 do
begin
close;
sql.Clear;
sqlstr :='select process Stations,count(distinct unit_id) InputQty from unit_status ';
sqlstr :=sqlstr +' where serial_number in (select track_id from TRACK_MASTER where front_end_job_id=''81001789'') and ' ;
sqlstr :=sqlstr +' modified_date>=to_date(''' + time1 + ''',''yyyy/mm/dd hh24:mi:ss'') and modified_date<=to_date(''' + time2 + ''',''yyyy/mm/dd hh24:mi:ss'') and ';
//sqlstr :=sqlstr +' modified_date between :a and :b and ';
sqlstr :=sqlStr + ' process in (''CMT'',''RFC'',''MIT'',''RFT'') group by process ' ;
sql.Add(sqlstr);
Open;