help with a programming concept

I want to develop a small system to keep fuel Records. Each machine being fueled has its mileage recorded and the amount of fuel. How can I be able to get the last fuel record bearing in mind that the odometer may be replaced and a machine can be fueled more than once in a given day. Help with ideas please