Can I create a rolling history?

I am trying to create a service database where we want to retain a history of the last 5 services(date and notes re service). Apart from manual input, is there any way of doing this so that the most recent service details go into an unused field until the number of services reaches 5? And then is it possible to have a rolling history so that each new service replaces the oldest service (ie number 5). Hopefully if there is a way of doing this I can understand how to implement it!!

Which application do you want to use? Base? Calc?

LesleyM :

I suppose you could simply QUERY your DB for for a particular customer but limit the number of rows of the result-set to 5:

EXAMPLE QUERY…

SELECT * FROM "YourTable" WHERE "customer_name" = :enter_customer_name ORDER BY "date" DESC LIMIT 5

NOTES: You would need to replace YourTable (in the double-quotes) with the name of the table holding your service history. The example query above is parameter-based, and Base will ask you to enter a customer name when you run the query. (We assume that a column called customer_name holds your (full) customer names in your service_history table, but of course you you may well - probably should - have a separate customer_name table related (by keys) to your service_history table. The ORDER BY…LIMIT 5 part limits the number of rows displayed to the 5 most recent ones.

This is just one idea. Maybe someone else might suggest a more elegant method.