A customer has invoices that are past due and isn't past due itself. So you need to extract the information out of the invoice table or the collections report.
Using the Invoice table, change 'Handy Builders' to the name of the customer you are interested in:
SELECT TxnDate as Date, RefNumber, PONumber, DueDate, {fn CURDATE()}-DueDate as "Aging" , BalanceRemaining FROM Invoice where IsPaid = 0 and DueDate <= {fn CURDATE()} and CustomerRefFullName = 'Handy Builders'
Or using the Collection Report, change 'Handy Builders' to the name of the customer you are interested in:
sp_report CollectionsReport show TxnType, Date, RefNumber, PONumber, Terms, DueDate, Aging, OpenBalance parameters DateMacro = 'Today', AgingAsOf = 'ReportEndDate', EntityFilterFullNameWithChildren = 'Handy Builders' where RowType='DataRow'
Note: The different aging values are because the QuickBooks sample company files set the QuickBooks date as December 15, 2007, while the current date (curdate) uses the system date of my computer which was April 6, 2007. |