Time between records in the same table

Topic Labels: Dates & Timezones
1067 2
Showing results for 
Search instead for 
Did you mean: 
6 - Interface Innovator
6 - Interface Innovator

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!

2 Replies 2

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):