Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I want to know how to write in SQL for the above mentioned.
after load below script :-
CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=False;User ID=SA;Initial Catalog=andonDatabas;Data Source=Paul;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=PAUL;Use Encryption for Data=False;Tag with column collation when possible=False];
select * from record_produksi_plc;
select * from record_downtime_plc;
select * from record_reject_detail_plc;
I get 2 field name , downtime_start_time and downtime_stop_time. i like to compute :-
downtime=downtime_start_time - downtime_stop_time
How to do it ?
Paul
Hi Paul,
Try this
LOAD
*,
downtime_start_time - downtime_stop_time AS downtime
select *
from record_downtime_plc;
Regards,
Sergey
Hi Paul,
Try this
LOAD
*,
downtime_start_time - downtime_stop_time AS downtime
select *
from record_downtime_plc;
Regards,
Sergey
Or it would be better
Time(Num(downtime_end_time)-Num(downtime_start_time),'s')
You will have downtime in seconds
Regards,
Sergey
Hi Sir
Thank you for sample code help a lot , it work now :-
LOAD
*,
Time(Num(downtime_end_time)-Num(downtime_start_time),'s') as downtime_;
//downtime_end_time - downtime_start_time AS downtime;
select * from record_downtime_plc;
Paul