10/14/2019 - 10:56 AM

draft dispatch query

select SUM(trn.Units) as DispatchQty

select plu.Code

from vw_ce_dms_transactions dms
left join oms_order_header orh
	ON orh.OrderNo = dms.WONo
left join datafiles_data cust
	ON cust.datafiledataid = orh.TraderID
left join datafiles_data plu
	ON plu.datafiledataid = dms.PLUID
left join ce_plu_file cplu
	ON cplu.PLUID = plu.DatafileDataID
left join oms_wo_lines orl
	ON orl.WONO = dms.WONo

where orh.TraderID = '8090'
AND dms.TransactionType like '%loading%'
and TransactionDateTime between '' and ''