Hi all … I’m working on a customer billing system and this one has me stumped.
I need to figure out the average amount of each customer’s last two bills. On the surface, this seemed like an easy query; but I’ve run into problems because not all customers have charges each month.
The table I’m using has the following 3 fields (derived from a Union Query): Customer Statement_Date Amt_Billed
I have no problem finding the latest statement for each customer … I can use a totals query to group by Customer, then use the Max function for the Statement date.
My problem is in finding the “NEXT to MAX” record for each customer. Anyone know of an easy way to do this?
Thanks in advance!
Jane
I need to figure out the average amount of each customer’s last two bills. On the surface, this seemed like an easy query; but I’ve run into problems because not all customers have charges each month.
The table I’m using has the following 3 fields (derived from a Union Query): Customer Statement_Date Amt_Billed
I have no problem finding the latest statement for each customer … I can use a totals query to group by Customer, then use the Max function for the Statement date.
My problem is in finding the “NEXT to MAX” record for each customer. Anyone know of an easy way to do this?
Thanks in advance!
Jane