I am trying to create a aging report using SQL.
I'm trying to grab the balance for all customers who had a invoice due in the previous month. So if it's March, then I want to show all the balances for invoices that were due in February.
This is what I came up with, but I keep getting 0 for the Customers that I know have balances in the month of February.
SELECT arar_cust_n, arar_due_date,
when arar_due_date = Month(DATEADD(mm, -1, GETDATE()))
End as thirtydaypassed