as i understand on that query it also gives the current dates. what I need is just like the Customer Aging in SAP B1 that shows all invoices and credit notes that are still open if I select a current date.
example:
I will run this query today (April 22) with the date of April 18 on the parameter. - the query must show all INvoices and Credit Notes that are/was open from april 18 backwards and will not show those closed from april 18 backwards.