Dispatch Time Diagnostics

From KeystoneIntranet
Jump to navigation Jump to search

Return Time Diagnostics

select t.ticket_no,T.TRUCK_NO,tgt_leave_job_dt,leave_job_dt,
   (leave_job_dt-tgt_leave_job_dt)*1440 "Late Mins",
   tgt_return_offset, tgt_return_plant_dt,
   tgt_return_plant_dt+(leave_job_dt-   tgt_leave_job_dt) "Projected Return DT",cast('now' as timestamp) "Now",
   (tgt_return_plant_dt+(leave_job_dt-tgt_leave_job_dt)-cast('now' as timestamp))*1440 "Min to Go"   , t.void_flag
from artptkhd t
inner join ditprjld l on t.order_session_no=l.order_session_no
   and t.order_trans_no=l.order_trans_no and l.load_no=t.order_load_no
where status_col=7 and t.void_flag<>'Y'