v 9 off a SQL database. My report is on sales and costs, grouped by contract number.
The main report is on sales, and has two tables: Ccs_Quotes which holds the contract details and Ccs_Sil_Invoice_Line, which holds the invoice details.
A parameter limits sales records to <= date and a select statement on the document type pulls out only records that have no sales doc or 2 types of sales document from a possible 6.
That works fine, but it is finding the first record it comes to and I need it to find the most recent. How do I tell it to find the most recent date of my selected types of document, given that there may be unwanted doc types with later dates?
The main report is on sales, and has two tables: Ccs_Quotes which holds the contract details and Ccs_Sil_Invoice_Line, which holds the invoice details.
A parameter limits sales records to <= date and a select statement on the document type pulls out only records that have no sales doc or 2 types of sales document from a possible 6.
That works fine, but it is finding the first record it comes to and I need it to find the most recent. How do I tell it to find the most recent date of my selected types of document, given that there may be unwanted doc types with later dates?