Time between records in the same table

We are managing all our orders in Airtable and I’m trying to calculate the time between orders to get an average for each customer.

So a client orders, say on September 13, and then the same client orders again September 19 and September 25. I’ve been trying to figure out a solution, but have a hard time.

How can I calculate the datetime_diff between records in the same table?

Thanks a lot!

Hi @Rupert_Hoffschmidt1 - you can’t do datetime_diff between records, only fields on the same record.

What I would recommend here is:

  • a script that sorts the records by date/time, then works out the time diff between each record and the next (then maybe calculates the average of whatever stat you need)
  • export the data into Excel/Sheets and do a similar thing there

Since the order records are linked to a record in another table, you could use a somewhat convoluted series of Rollups to calculate over your records.

Here’s an example base which does something similar (it has more fields than you need since it calculates the difference between a field other than the date):

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.