Finding a previous record in portal that is based on a checkbox result
I hope this can be done because I need to create a calculation from this.
I have a layout with a portal on. This portal has Equipment Name, Total Running Hours fields and a checkbox with yes/no for Oil Change. A new record is created on a daily basis recording the total running hours and if the oil has been changed or not.
I need to write a calculation that determines the running hours since the last oil change, i.e. between "todays" record and the last record that had "Yes" checked in the checkbox in the portal under Oil Change. I'm thinking I need to search for this record, set the variable of the total running hours field and calculate the difference between them to find the result. I have no idea to go about this though so any help would be appreciated.
Bear in mind, there will be multiple pieces of equipment in the portal so I'm not sure if that will make a difference in searching for that record.