Skip to Content
0
Former Member
Apr 20, 2011 at 07:00 AM

Aged Debtors Report by Account Manager (Sales person)

25 Views

Hi experts

I've created the following SQL Query to identify the ageing of balance outstanding on Open Sales Invoices. I'd like to include Credit Notes but do not have the expertise. Hope someone can help?

Thanks in advance

Derek

SELECT T1.[CardCode] AS 'Cust Code', T1.[CardName] AS 'Customer', T1.[DocNum] AS 'Inv No', T1.[TaxDate] AS 'Doc Date', T1.[DocDueDate] AS 'Doc Due Date', T1.[DocCur] AS 'FX', T1.[DocTotalFC] AS 'Doc Total FX', T1.[DocTotal] AS 'Doc Total u20AC',T1.[DocTotal] - T1.[PaidSum] AS 'Bal Due u20AC', T0.[SlpName] AS 'AC Mgr',DATEDIFF(day,T1.DocDueDate,getdate()) AS 'Days Overdue' FROM OSLP T0 INNER JOIN OINV T1 ON T0.SlpCode = T1.SlpCode WHERE T1.[DocStatus] ='O'