Allow to use Datetime fields in Min and Max aggregations

Greetings.

I’ve noticed Datetime fields cannot be used when defining a Min or Max aggregation on a Tulip table. This sounds rather strange since these two aggregations make sense for a set of datetimes, Min being the “oldest” point in time in the set and Max being the “most recent”. (Note that Min isn’t necessarily in the past and Max isn’t necessarily in the future).

I needed this today in a log table to know when the first (= oldest) task in the set of task logs I queried was started to compute a duration. This could also be useful to compute the duration from the first task’s beginning to the latest task’s end in an app (that is, from Min(Start date) to Max(End date)).

A workaround for this is to create separate queries sorting the results by date oldest first or newest first and limiting to one record, then using the Mode aggregation on your datetime field.

1 Like