- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 29, 2025 08:12 PM - edited Jan 29, 2025 08:25 PM
Hi all,
I'd like some help w/ a rollup field.
Table A is a summary record for an order and table B has the line items of an order. Each line item can have a different delivery date. I'd like to create a rollup field in table A that calculates the difference between the min and max delivery dates of all line items in table B.
This rollup field presently looks like: DATETIME_DIFF(MAX(values),MIN(values),'days'). When I do this, I always get values of 0 returned. I suspect that I cannot use a datetime_diff function within a rollup but I'm not getting an error so I wanted to confirm? (I also just tried max(values) - min(values) but that doesn't work either, (also returns 0s). I'd rather have a single field in my data to perform this function over 3 (one for min, one for max, one for the difference). Any suggestions / confirmation that this just isn't possible using dates?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 29, 2025 08:23 PM
Hey @becca826,
I never tried this before, but it is an interesting use case.
Did you try including the time unit for the date time diff? See suggested fórmula below:
DATETIME_DIFF(MAX(values),MIN(values), “days”)
Please let me know if that works! I’m on my phone rn, so I cannot give it a shot easily.
Mike, Consultant @ Automatic Nation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 29, 2025 08:27 PM
ah yeah, thanks - that was just an unfortunate typo on my part in my question (now edited)- I did in fact write the formula using days.. It would throw a formulaic error without the days in there I think. That's why I'm a bit perplexed. I figured if this weren't a valid construction that it wouldn't let me actually use the formula.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 30, 2025 05:37 AM
Yeap, confirming. Doing the following will just give you '0 test' as well, and DATETIME_FORMAT just errors out too
MAX(values) & ' test'
![ScottWorld ScottWorld](https://community.airtable.com/legacyfs/online/avatars/3X/7/e/7eff84feb0baf275c7ef4416aa8f1be38dbb1471.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 30, 2025 06:55 AM
I think you just stumbled upon a bug there in Airtable, because that formula SHOULD work properly in a rollup field.
Please be sure to report that as a bug to support@airtable.com, so they can hopefully address it in the future!
- ScottWorld, Expert Airtable Consultant
![](/skins/images/DD0CD7D0ACF200EF4456420D87029A3D/responsive_peak/images/icon_anonymous_message.png)