I'm new to SQL so any help I can get is really appreciated.
I need to run a SQL Query for Average Days to Pay group by Customer, YTD and PYTD.
Anyone here as a script to share?
Thanks.
The average number of days by which this customer needs to pay the current open invoices.
This value is calculated by dividing the total days to pay for all invoices by how many invoices have so far been paid.
Average Days to Pay = (Last Cash Detail Date for the Invoice - (Cash Detail Date - Invoice Date)) / Number of Invoices Paid
This value is displayed in two fields. One field displays the current Average Days to Pay (YTD Totals),
while the other field displays last year's Average Days to Pay (Last Year Totals).
Note that the Average Days to Pay, YTD, and last year's totals are based on the fiscal year, not the calendar year.
The
Average Days to Pay field displays the customer's average
number of days from the invoice date to the last payment date.
This field only calculates aging for invoices opened and closed during the
fiscal year.
>>MS SQL
Sorry, all I have right now is an old V8/Progress/ODBC report.