This SQL Statment will give you the data you are after:
SELECT InvoiceLine.InvoiceLineItemRefFullName as Type, InvoiceLine.TxnDate as Date, InvoiceLine.DueDate, InvoiceLine.RefNumber as Num, InvoiceLine.CustomerRefFullName as Name, InvoiceLine.InvoiceLineQuantity as Qty, InvoiceLine.InvoiceLineAmount as Amount, InvoiceLine.ClassRefFullName as Class, InvoiceLine.Memo, Item.CustomFieldColor as CustomField1, ({fn CURDATE()}-InvoiceLine.TxnDate) as Aging FROM InvoiceLine, Item where InvoiceLine.InvoiceLineItemRefListID = Item.ListID
but you will need to replace Color in the above with the name that you have given for the custom field. Run:
sp_columns item
to locate the custom field names.
Note: Aging is based on the actual current system date (not the QuickBooks date). |