(Back to A-AD Administration Module SQL Posted to Wiki Listing - A-AD Administration Module SQL Posted to Wiki )
TYPE: Frequently Requested SQL
AUTHOR NAME: Zal Parchem
PURPOSE AND BACKGROUND: This SQL was created in Version 8.8 PL16. This SQL shows those AP Invoices which are overdue in being paid or are close to being paid. The current range goes out 7 days into the future but can be changed to 14 by changing the WHERE section with the DATEDIFF with a "-14". It all depends upon how your company needs the Alert Message to display. You can use "copy and paste" to move this Alert Message into your system and set the Alert Message to "Hourly" or whatever frequency is good for your company.
Here is a screen print of the SQL results:
Copy and Paste this SQL:
--A-AD Alert Mess of AP Invoices Coming or Past Due Ver 1 ZP 2009 12 25
--DESCRIPTION: SQL displays AP Invoices that are close to being processed for payment or are past due being paid.
--Version 1 Zal Parchem 2009 12 25
T0.DocNum AS 'AP Inv Num',
T0.DocDueDate AS 'Due Date',
T0.CardCode AS 'Vend Num',
T0.CardName AS 'Vend Name'
FROM OPCH T0
DATEDIFF (DD, T0.DocDueDate, GETDATE( )) BETWEEN -7 AND 365
AND T0.DocStatus = 'O'
ORDER BY T0.DocDueDate