I have a history table with HistoryID (auton), HistoryDate and HistoryAmount. Each time a customer’s payment changes (usually annually) I add a new entry for each customer.
For a billing report I need to establish the difference between the latest amount and the previous (second last) amount so that I can work with the difference.
I can get to the latest amount by using an aggregate function (last) in the query, but I don’t know how to get at the previous amount. Can anyone help?