on 05-11-2017 1:56 PM
Hi Experts
I am trying to create a query and alert to show where Sales Order which a linked Purchase Order (back to back ordering) have a diffference in delivery dates where the Sales Order rows are showing an earlier deilivery to the Purchase Order which means delivery would not be possible. My query is running into problems and I am not sure where to look for answers, The query runs okay but it is showing me both rows with an earlier delivery date and later delivery to the respective PO:
select distinct T0.[DocNum] , T0.[U_ReadyTD] , T0.[CardCode] , T0.[CardName] , T0.[DocDueDate] , T1.[LineNum] , T1.[ItemCode] , T1.[Dscription] , T1.[Quantity] , T1.[POTRGNUM] , T0.[DocDueDate] as 'SO Delivery Date' , T2.[ShipDate] as 'PO Delivery Date' from
ORDR T0 inner join RDR1 T1 on T0.DocEntry = T1.DocEntry INNER JOIN POR1 T2 ON T0.DocNum = T2.BaseRef
where T0.[DocStatus] = 'O' and T1.[POTRGNUM] is not null and 'T0.[DocDueDate]' < 'T2.[ShipDate]'
order by t0.docnum, t1.linenum
Many thanks
Geoff
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.