Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8082

Re: Vendor on time delivery query

$
0
0

I think no problem in where clause. Try this query:

 

SELECT T0.[DocNum] 'PO #', T0.[DocDate] 'PO Posting Date', T1.[ShipDate] 'PO Line Item Due Date', T0.[DocDueDate] 'PO Due Date', T0.[CardName], T0.[NumAtCard], IsNull(T3.[DocDate],'') 'GRPO Date', DateDiff (dd, ISNULL(T1.ShipDate,T0.DocDueDate),T3.DocDate) 'Delay'

FROM OPOR T0

INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry

LEFT JOIN PDN1 T2 ON T0.DocEntry=T2.BaseEntry AND T1.LineNum=T2.BaseLine

LEFT JOIN OPDN T3 ON T2.DocEntry = T3.DocEntry

WHERE T0.DocDate>= [%0]  and T0.DocDate<=[%1]  and DateDiff (dd, ISNULL(T1.ShipDate,T0.DocDueDate),T3.DocDate) >0

group by T0.[DocNum], T0.[DocDate],  T1.[ShipDate] , T0.[DocDueDate] , T0.[CardName], T0.[NumAtCard], T3.[DocDate], T1.ShipDate,T0.DocDueDate,T3.DocDate

 

 

Having DateDiff (dd, ISNULL(T1.ShipDate,T0.DocDueDate),T3.DocDate) >0


Viewing all articles
Browse latest Browse all 8082

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>