Quantcast
Channel: SCN : Unanswered Discussions - Reporting and Printing
Viewing all articles
Browse latest Browse all 776

Average Days to Pay

$
0
0

Here is a query that will display the Average Days to Pay against a BPCode:-

 

SELECT

T4.CardCode, (SUM(DateDiff(DD, T4.DocDate, T1.DocDate))/COUNT(T4.DocNum)) AS 'AVG. Days to Pay'

FROM OCRD T0

INNER JOIN ORCT T1

ON T0.CardCode = T1.CardCode

INNER JOIN RCT2 T3

ON T3.DocNum = T1.DocNum

INNER JOIN OINV T4

ON T4.DocEntry = T3.DocEntry

AND T3.InvType = '13'

GROUP BY T4.CardCode

ORDER BY 'AVG. Days to Pay' DESC

 

Many thanks

 

Alan


Viewing all articles
Browse latest Browse all 776

Trending Articles



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